From 9618f57150a105b03369e3ca61119665e91de5f9 Mon Sep 17 00:00:00 2001 From: huangzifeng Date: Tue, 14 Jan 2025 18:55:22 +0800 Subject: [PATCH] Revert feature mull64 --- ...ch64-Remove-XFAILs-for-two-SVE-tests.patch | 48 + 0123-Revert-feature-mull64.patch | 2075 +++++++++++++++++ gcc.spec | 12 +- 3 files changed, 2134 insertions(+), 1 deletion(-) create mode 100644 0122-aarch64-Remove-XFAILs-for-two-SVE-tests.patch create mode 100644 0123-Revert-feature-mull64.patch diff --git a/0122-aarch64-Remove-XFAILs-for-two-SVE-tests.patch b/0122-aarch64-Remove-XFAILs-for-two-SVE-tests.patch new file mode 100644 index 0000000..c11ca7b --- /dev/null +++ b/0122-aarch64-Remove-XFAILs-for-two-SVE-tests.patch @@ -0,0 +1,48 @@ +From 77d1b4bd1b72be3769b2544f7f1e4a390fbf8e60 Mon Sep 17 00:00:00 2001 +From: Richard Sandiford +Date: Tue, 17 Nov 2020 12:02:50 +0000 +Subject: [PATCH] aarch64: Remove XFAILs for two SVE tests + +These tests started passing a while ago, so remove the XFAILs. + +gcc/testsuite/ + * gcc.target/aarch64/sve/cond_cnot_1.c: Remove XFAIL. + * gcc.target/aarch64/sve/cond_unary_1.c: Likewise. + +Reference commit in GCC: 0f6759240f1df4240483d0ac3744ac60e82e702f +Signed-off-by: Pronin Alexander 00812787 +--- + gcc/testsuite/gcc.target/aarch64/sve/cond_cnot_1.c | 5 ++--- + gcc/testsuite/gcc.target/aarch64/sve/cond_unary_1.c | 6 ++---- + 2 files changed, 4 insertions(+), 7 deletions(-) + +diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cond_cnot_1.c b/gcc/testsuite/gcc.target/aarch64/sve/cond_cnot_1.c +index f587da1fb..49f0b18a5 100644 +--- a/gcc/testsuite/gcc.target/aarch64/sve/cond_cnot_1.c ++++ b/gcc/testsuite/gcc.target/aarch64/sve/cond_cnot_1.c +@@ -30,6 +30,5 @@ TEST_ALL (DEF_LOOP) + /* { dg-final { scan-assembler-times {\tcnot\tz[0-9]+\.d, p[0-7]/m,} 2 } } */ + + /* { dg-final { scan-assembler-not {\tmov\tz} } } */ +-/* { dg-final { scan-assembler-not {\tmovprfx\t} { xfail *-*-* } } } */ +-/* Currently we canonicalize the ?: so that !b[i] is the "false" value. */ +-/* { dg-final { scan-assembler-not {\tsel\t} { xfail *-*-* } } } */ ++/* { dg-final { scan-assembler-not {\tmovprfx\t} } } */ ++/* { dg-final { scan-assembler-not {\tsel\t} } } */ +diff --git a/gcc/testsuite/gcc.target/aarch64/sve/cond_unary_1.c b/gcc/testsuite/gcc.target/aarch64/sve/cond_unary_1.c +index addedfa28..049247671 100644 +--- a/gcc/testsuite/gcc.target/aarch64/sve/cond_unary_1.c ++++ b/gcc/testsuite/gcc.target/aarch64/sve/cond_unary_1.c +@@ -53,7 +53,5 @@ TEST_ALL (DEF_LOOP) + /* { dg-final { scan-assembler-times {\tfneg\tz[0-9]+\.d, p[0-7]/m,} 1 } } */ + + /* { dg-final { scan-assembler-not {\tmov\tz} } } */ +-/* { dg-final { scan-assembler-not {\tmovprfx\t} { xfail *-*-* } } } */ +-/* XFAILed because the ?: gets canonicalized so that the operation is in +- the false arm. */ +-/* { dg-final { scan-assembler-not {\tsel\t} { xfail *-*-* } } } */ ++/* { dg-final { scan-assembler-not {\tmovprfx\t} } } */ ++/* { dg-final { scan-assembler-not {\tsel\t} } } */ +-- +2.33.0 + diff --git a/0123-Revert-feature-mull64.patch b/0123-Revert-feature-mull64.patch new file mode 100644 index 0000000..7e76caf --- /dev/null +++ b/0123-Revert-feature-mull64.patch @@ -0,0 +1,2075 @@ +From 577153c649e31d48c019c5b413b4253ced7104db Mon Sep 17 00:00:00 2001 +From: Pronin Alexander +Date: Tue, 14 Jan 2025 18:40:13 +0800 +Subject: [PATCH] Revert feature mull64 + +--- + gcc/builtin-types.def | 4 - + gcc/builtins.c | 2 - + gcc/builtins.def | 2 - + gcc/common.opt | 8 - + gcc/doc/extend.texi | 10 +- + gcc/fold-const-call.c | 1 - + gcc/fold-const.c | 2 - + gcc/match.pd | 104 ---- + gcc/optabs.c | 5 +- + gcc/testsuite/g++.dg/opt/pr94589-1.C | 33 -- + gcc/testsuite/g++.dg/opt/pr94589-2.C | 33 -- + gcc/testsuite/g++.dg/opt/pr94589-3.C | 84 --- + gcc/testsuite/g++.dg/opt/pr94589-4.C | 84 --- + gcc/testsuite/g++.dg/tree-ssa/mull64.C | 35 -- + gcc/testsuite/gcc.dg/pr107190.c | 27 - + gcc/testsuite/gcc.dg/pr94589-1.c | 35 -- + gcc/testsuite/gcc.dg/pr94589-2.c | 35 -- + gcc/testsuite/gcc.dg/pr94589-3.c | 97 ---- + gcc/testsuite/gcc.dg/pr94589-4.c | 97 ---- + gcc/testsuite/gcc.dg/pr97238.c | 12 - + gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/bool-1.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/bool-2.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-22.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-25.c | 83 --- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/pr18134.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/pr21829.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/pr96928-1.c | 2 +- + gcc/testsuite/gcc.dg/tree-ssa/pr97503.c | 19 - + gcc/tree-core.h | 1 - + gcc/tree-ssa-ccp.c | 1 - + gcc/tree-ssa-phiopt.c | 633 ++------------------- + gcc/tree-ssa-reassoc.c | 4 +- + gcc/tree-vect-stmts.c | 5 +- + gcc/tree.c | 2 - + gcc/tree.h | 1 - + 40 files changed, 62 insertions(+), 1419 deletions(-) + delete mode 100644 gcc/testsuite/g++.dg/opt/pr94589-1.C + delete mode 100644 gcc/testsuite/g++.dg/opt/pr94589-2.C + delete mode 100644 gcc/testsuite/g++.dg/opt/pr94589-3.C + delete mode 100644 gcc/testsuite/g++.dg/opt/pr94589-4.C + delete mode 100644 gcc/testsuite/g++.dg/tree-ssa/mull64.C + delete mode 100644 gcc/testsuite/gcc.dg/pr107190.c + delete mode 100644 gcc/testsuite/gcc.dg/pr94589-1.c + delete mode 100644 gcc/testsuite/gcc.dg/pr94589-2.c + delete mode 100644 gcc/testsuite/gcc.dg/pr94589-3.c + delete mode 100644 gcc/testsuite/gcc.dg/pr94589-4.c + delete mode 100644 gcc/testsuite/gcc.dg/pr97238.c + delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-25.c + delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr97503.c + +diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def +index c46b1bc5c..c7aa691b2 100644 +--- a/gcc/builtin-types.def ++++ b/gcc/builtin-types.def +@@ -73,9 +73,6 @@ DEF_PRIMITIVE_TYPE (BT_UINT8, unsigned_char_type_node) + DEF_PRIMITIVE_TYPE (BT_UINT16, uint16_type_node) + DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node) + DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node) +-DEF_PRIMITIVE_TYPE (BT_UINT128, uint128_type_node +- ? uint128_type_node +- : error_mark_node) + DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1)) + DEF_PRIMITIVE_TYPE (BT_UNWINDWORD, (*lang_hooks.types.type_for_mode) + (targetm.unwind_word_mode (), 1)) +@@ -303,7 +300,6 @@ DEF_FUNCTION_TYPE_1 (BT_FN_UINT8_FLOAT, BT_UINT8, BT_FLOAT) + DEF_FUNCTION_TYPE_1 (BT_FN_UINT16_UINT16, BT_UINT16, BT_UINT16) + DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32) + DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64) +-DEF_FUNCTION_TYPE_1 (BT_FN_UINT128_UINT128, BT_UINT128, BT_UINT128) + DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_FLOAT, BT_UINT64, BT_FLOAT) + DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT) + DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_PTR, BT_BOOL, BT_PTR) +diff --git a/gcc/builtins.c b/gcc/builtins.c +index 1b1c75cc1..10b6fd3bb 100644 +--- a/gcc/builtins.c ++++ b/gcc/builtins.c +@@ -8015,7 +8015,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, + case BUILT_IN_BSWAP16: + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: +- case BUILT_IN_BSWAP128: + target = expand_builtin_bswap (target_mode, exp, target, subtarget); + if (target) + return target; +@@ -11733,7 +11732,6 @@ is_inexpensive_builtin (tree decl) + case BUILT_IN_BSWAP16: + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: +- case BUILT_IN_BSWAP128: + case BUILT_IN_CLZ: + case BUILT_IN_CLZIMAX: + case BUILT_IN_CLZL: +diff --git a/gcc/builtins.def b/gcc/builtins.def +index ee67ac15d..fa8b0641a 100644 +--- a/gcc/builtins.def ++++ b/gcc/builtins.def +@@ -834,8 +834,6 @@ DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_L + DEF_GCC_BUILTIN (BUILT_IN_BSWAP16, "bswap16", BT_FN_UINT16_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST) + DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LEAF_LIST) + DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LEAF_LIST) +-DEF_GCC_BUILTIN (BUILT_IN_BSWAP128, "bswap128", BT_FN_UINT128_UINT128, ATTR_CONST_NOTHROW_LEAF_LIST) +- + DEF_EXT_LIB_BUILTIN (BUILT_IN_CLEAR_CACHE, "__clear_cache", BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LEAF_LIST) + /* [trans-mem]: Adjust BUILT_IN_TM_CALLOC if BUILT_IN_CALLOC is changed. */ + DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_WARN_UNUSED_RESULT_SIZE_1_2_NOTHROW_LEAF_LIST) +diff --git a/gcc/common.opt b/gcc/common.opt +index 238c97db8..1ec119625 100644 +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -2071,10 +2071,6 @@ fmerge-debug-strings + Common Report Var(flag_merge_debug_strings) Init(1) + Attempt to merge identical debug strings across compilation units. + +-fmerge-mull +-Common Report Var(flag_merge_mull) Init(0) Optimization +-Attempt to merge series instructions into mul. +- + fmessage-length= + Common RejectNegative Joined UInteger + -fmessage-length= Limit diagnostics to characters per line. 0 suppresses line-wrapping. +@@ -2787,10 +2783,6 @@ ftree-store-ccp + Common Ignore + Does nothing. Preserved for backward compatibility. + +-ftree-fold-phiopt +-Common Report Var(flag_fold_phiopt) Init(0) Optimization +-Attempt to simply the phi node with ssa form. +- + ftree-ch + Common Report Var(flag_tree_ch) Optimization + Enable loop header copying on trees. +diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi +index a7bd772de..9c7345959 100644 +--- a/gcc/doc/extend.texi ++++ b/gcc/doc/extend.texi +@@ -13727,20 +13727,14 @@ exactly 8 bits. + + @deftypefn {Built-in Function} uint32_t __builtin_bswap32 (uint32_t x) + Similar to @code{__builtin_bswap16}, except the argument and return types +-are 32-bit. ++are 32 bit. + @end deftypefn + + @deftypefn {Built-in Function} uint64_t __builtin_bswap64 (uint64_t x) + Similar to @code{__builtin_bswap32}, except the argument and return types +-are 64-bit. ++are 64 bit. + @end deftypefn + +-@deftypefn {Built-in Function} uint128_t __builtin_bswap128 (uint128_t x) +-Similar to @code{__builtin_bswap64}, except the argument and return types +-are 128-bit. Only supported on targets when 128-bit types are supported. +-@end deftypefn +- +- + @deftypefn {Built-in Function} Pmode __builtin_extend_pointer (void * x) + On targets where the user visible pointer size is smaller than the size + of an actual hardware address this function returns the extended user +diff --git a/gcc/fold-const-call.c b/gcc/fold-const-call.c +index da01759d9..6150d7ada 100644 +--- a/gcc/fold-const-call.c ++++ b/gcc/fold-const-call.c +@@ -1032,7 +1032,6 @@ fold_const_call_ss (wide_int *result, combined_fn fn, const wide_int_ref &arg, + case CFN_BUILT_IN_BSWAP16: + case CFN_BUILT_IN_BSWAP32: + case CFN_BUILT_IN_BSWAP64: +- case CFN_BUILT_IN_BSWAP128: + *result = wide_int::from (arg, precision, TYPE_SIGN (arg_type)).bswap (); + return true; + +diff --git a/gcc/fold-const.c b/gcc/fold-const.c +index 78227a83d..6e635382f 100644 +--- a/gcc/fold-const.c ++++ b/gcc/fold-const.c +@@ -13889,10 +13889,8 @@ tree_call_nonnegative_warnv_p (tree type, combined_fn fn, tree arg0, tree arg1, + CASE_CFN_POPCOUNT: + CASE_CFN_CLZ: + CASE_CFN_CLRSB: +- case CFN_BUILT_IN_BSWAP16: + case CFN_BUILT_IN_BSWAP32: + case CFN_BUILT_IN_BSWAP64: +- case CFN_BUILT_IN_BSWAP128: + /* Always true. */ + return true; + +diff --git a/gcc/match.pd b/gcc/match.pd +index 01f81b063..fc1a34dd3 100644 +--- a/gcc/match.pd ++++ b/gcc/match.pd +@@ -3383,110 +3383,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) + ) + #endif + +-#if GIMPLE +-(if (canonicalize_math_p ()) +-/* These patterns are mostly used by PHIOPT to move some operations outside of +- the if statements. They should be done late because it gives jump threading +- and few other passes to reduce what is going on. */ +-/* a ? x op C : x -> x op (a << log2(C)) when C is power of 2. */ +- (for op (plus minus bit_ior bit_xor lshift rshift lrotate rrotate) +- (simplify +- (cond @0 (op:s @1 integer_pow2p@2) @1) +- /* powerof2cst */ +- (if (flag_merge_mull && INTEGRAL_TYPE_P (type)) +- (with { +- tree shift = build_int_cst (integer_type_node, tree_log2 (@2)); +- } +- (op @1 (lshift (convert (convert:boolean_type_node @0)) { shift; }))) +- ) +- ) +- ) +-) +-#endif +- +-#if GIMPLE +-/* These patterns are mostly used by FORWPROP4 to move some operations outside of +- the if statements. They should be done late because it gives jump threading +- and few other passes to reduce what is going on. */ +-/* Mul64 is defined as a multiplication algorithm which compute two 64-bit +- integers to one 128-bit integer. Try to match the high part of mul pattern +- after the low part of mul pattern is simplified. The following scenario +- should be matched: +- (i64 ResLo, i64 ResHi) = Mul64(i64 In0, i64 In1) { +- In0Lo = In0(D) & 4294967295; -- bit_and@4 SSA_NAME@0 @2 +- In0Hi = In0(D) >> 32; -- rshift@5 SSA_NAME@0 @3 +- In1Lo = In1(D) & 4294967295; -- bit_and@6 SSA_NAME@1 INTEGER_CST@2 +- In1Hi = In1(D) >> 32; -- rshift@7 SSA_NAME@1 INTEGER_CST@3 +- Mull_01 = In0Hi * In1Lo; -- mult@8 @5 @6 +- Addc = In0Lo * In1Hi + Mull_01; -- plus@9 (mult (@4 @7) @8 +- AddH = (Addc >> 32) + In0Hi * In1Hi -- (plus@11 (rshift @9 @3) (mult @5 @7)) +- addc32 = Addc << 32; -- lshift@10 @9 @3 +- ResLo = In0(D) * In1(D); -- mult @0 @1 +- ResHi = ((long unsigned int) (addc32 > ResLo)) + +- (((long unsigned int) (Mull_01 > Addc)) << 32) + AddH; +- } */ +-(simplify +- (plus:c +- (plus:c +- (convert +- (gt (lshift@10 @9 @3) +- (mult:c @0 @1))) +- (lshift +- (convert +- (gt @8 @9)) +- @3)) +- (plus:c@11 +- (rshift +- (plus:c@9 +- (mult:c (bit_and@4 SSA_NAME@0 @2) @7) +- (mult:c@8 @5 (bit_and@6 SSA_NAME@1 INTEGER_CST@2))) +- @3) +- (mult:c (rshift@5 SSA_NAME@0 @3) +- (rshift@7 SSA_NAME@1 INTEGER_CST@3)) +- ) +- ) +- (if (flag_merge_mull && INTEGRAL_TYPE_P (type) +- && INTEGRAL_TYPE_P (TREE_TYPE (@0)) && types_match (@0, @1) +- && TYPE_PRECISION (type) == 64) +- (with { +- tree i128_type = build_nonstandard_integer_type (128, TYPE_UNSIGNED (type)); +- tree shift = build_int_cst (integer_type_node, 64); +- } +- (convert:type (rshift +- (mult (convert:i128_type @0) +- (convert:i128_type @1)) +- { shift; }))) +- ) +-) +-#endif +- +-#if GIMPLE +-/* These patterns are mostly used by FORWPROP1 to fold some operations into more +- simple IR. The following scenario should be matched: +- In0Lo = In0(D) & 4294967295; +- In0Hi = In0(D) >> 32; +- In1Lo = In1(D) & 4294967295; +- In1Hi = In1(D) >> 32; +- Addc = In0Lo * In1Hi + In0Hi * In1Lo; +- addc32 = Addc << 32; +- ResLo = In0Lo * In1Lo + addc32 */ +-(simplify +- (plus:c (mult @4 @5) +- (lshift +- (plus:c +- (mult (bit_and@4 SSA_NAME@0 @2) (rshift SSA_NAME@1 @3)) +- (mult (rshift SSA_NAME@0 @3) (bit_and@5 SSA_NAME@1 INTEGER_CST@2))) +- INTEGER_CST@3 +- ) +- ) +- (if (flag_merge_mull && INTEGRAL_TYPE_P (type) +- && INTEGRAL_TYPE_P (TREE_TYPE (@0)) && types_match (@0, @1) +- && TYPE_PRECISION (type) == 64) +- (mult (convert:type @0) (convert:type @1)) +- ) +-) +-#endif +- + /* Simplification moved from fold_cond_expr_with_comparison. It may also + be extended. */ + /* This pattern implements two kinds simplification: +diff --git a/gcc/optabs.c b/gcc/optabs.c +index 64a1a1768..2b7c3e6fb 100644 +--- a/gcc/optabs.c ++++ b/gcc/optabs.c +@@ -2896,11 +2896,8 @@ expand_unop (machine_mode mode, optab unoptab, rtx op0, rtx target, + if (temp) + return temp; + +- /* We do not provide a 128-bit bswap in libgcc so force the use of +- a double bswap for 64-bit targets. */ + if (GET_MODE_SIZE (int_mode) == 2 * UNITS_PER_WORD +- && (UNITS_PER_WORD == 64 +- || optab_handler (unoptab, word_mode) != CODE_FOR_nothing)) ++ && optab_handler (unoptab, word_mode) != CODE_FOR_nothing) + { + temp = expand_doubleword_bswap (mode, op0, target); + if (temp) +diff --git a/gcc/testsuite/g++.dg/opt/pr94589-1.C b/gcc/testsuite/g++.dg/opt/pr94589-1.C +deleted file mode 100644 +index d1cc5050c..000000000 +--- a/gcc/testsuite/g++.dg/opt/pr94589-1.C ++++ /dev/null +@@ -1,33 +0,0 @@ +-// PR tree-optimization/94589 +-// { dg-do compile { target c++20 } } +-// { dg-options "-O2 -g0 -fdump-tree-optimized" } +-// { dg-final { scan-tree-dump-times "\[ij]_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) \[ij]_\[0-9]+\\(D\\)" 12 "optimized" } } +-// { dg-final { scan-tree-dump-times "i_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) \[45]" 12 "optimized" } } +- +-#include +- +-#define A __attribute__((noipa)) +-A bool f1 (int i, int j) { auto c = i <=> j; return c == 0; } +-A bool f2 (int i, int j) { auto c = i <=> j; return c != 0; } +-A bool f3 (int i, int j) { auto c = i <=> j; return c > 0; } +-A bool f4 (int i, int j) { auto c = i <=> j; return c < 0; } +-A bool f5 (int i, int j) { auto c = i <=> j; return c >= 0; } +-A bool f6 (int i, int j) { auto c = i <=> j; return c <= 0; } +-A bool f7 (int i, int j) { auto c = i <=> j; return c == std::strong_ordering::less; } +-A bool f8 (int i, int j) { auto c = i <=> j; return c != std::strong_ordering::less; } +-A bool f9 (int i, int j) { auto c = i <=> j; return c == std::strong_ordering::equal; } +-A bool f10 (int i, int j) { auto c = i <=> j; return c != std::strong_ordering::equal; } +-A bool f11 (int i, int j) { auto c = i <=> j; return c == std::strong_ordering::greater; } +-A bool f12 (int i, int j) { auto c = i <=> j; return c != std::strong_ordering::greater; } +-A bool f13 (int i) { auto c = i <=> 5; return c == 0; } +-A bool f14 (int i) { auto c = i <=> 5; return c != 0; } +-A bool f15 (int i) { auto c = i <=> 5; return c > 0; } +-A bool f16 (int i) { auto c = i <=> 5; return c < 0; } +-A bool f17 (int i) { auto c = i <=> 5; return c >= 0; } +-A bool f18 (int i) { auto c = i <=> 5; return c <= 0; } +-A bool f19 (int i) { auto c = i <=> 5; return c == std::strong_ordering::less; } +-A bool f20 (int i) { auto c = i <=> 5; return c != std::strong_ordering::less; } +-A bool f21 (int i) { auto c = i <=> 5; return c == std::strong_ordering::equal; } +-A bool f22 (int i) { auto c = i <=> 5; return c != std::strong_ordering::equal; } +-A bool f23 (int i) { auto c = i <=> 5; return c == std::strong_ordering::greater; } +-A bool f24 (int i) { auto c = i <=> 5; return c != std::strong_ordering::greater; } +diff --git a/gcc/testsuite/g++.dg/opt/pr94589-2.C b/gcc/testsuite/g++.dg/opt/pr94589-2.C +deleted file mode 100644 +index dda947e22..000000000 +--- a/gcc/testsuite/g++.dg/opt/pr94589-2.C ++++ /dev/null +@@ -1,33 +0,0 @@ +-// PR tree-optimization/94589 +-// { dg-do compile { target c++20 } } +-// { dg-options "-O2 -g0 -ffast-math -fdump-tree-optimized" } +-// { dg-final { scan-tree-dump-times "\[ij]_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) \[ij]_\[0-9]+\\(D\\)" 14 "optimized" } } +-// { dg-final { scan-tree-dump-times "i_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) 5\\.0" 14 "optimized" } } +- +-#include +- +-#define A __attribute__((noipa)) +-A bool f1 (double i, double j) { auto c = i <=> j; return c == 0; } +-A bool f2 (double i, double j) { auto c = i <=> j; return c != 0; } +-A bool f3 (double i, double j) { auto c = i <=> j; return c > 0; } +-A bool f4 (double i, double j) { auto c = i <=> j; return c < 0; } +-A bool f5 (double i, double j) { auto c = i <=> j; return c >= 0; } +-A bool f6 (double i, double j) { auto c = i <=> j; return c <= 0; } +-A bool f7 (double i, double j) { auto c = i <=> j; return c == std::partial_ordering::less; } +-A bool f8 (double i, double j) { auto c = i <=> j; return c != std::partial_ordering::less; } +-A bool f9 (double i, double j) { auto c = i <=> j; return c == std::partial_ordering::equivalent; } +-A bool f10 (double i, double j) { auto c = i <=> j; return c != std::partial_ordering::equivalent; } +-A bool f11 (double i, double j) { auto c = i <=> j; return c == std::partial_ordering::greater; } +-A bool f12 (double i, double j) { auto c = i <=> j; return c != std::partial_ordering::greater; } +-A bool f13 (double i) { auto c = i <=> 5.0; return c == 0; } +-A bool f14 (double i) { auto c = i <=> 5.0; return c != 0; } +-A bool f15 (double i) { auto c = i <=> 5.0; return c > 0; } +-A bool f16 (double i) { auto c = i <=> 5.0; return c < 0; } +-A bool f17 (double i) { auto c = i <=> 5.0; return c >= 0; } +-A bool f18 (double i) { auto c = i <=> 5.0; return c <= 0; } +-A bool f19 (double i) { auto c = i <=> 5.0; return c == std::partial_ordering::less; } +-A bool f20 (double i) { auto c = i <=> 5.0; return c != std::partial_ordering::less; } +-A bool f21 (double i) { auto c = i <=> 5.0; return c == std::partial_ordering::equivalent; } +-A bool f22 (double i) { auto c = i <=> 5.0; return c != std::partial_ordering::equivalent; } +-A bool f23 (double i) { auto c = i <=> 5.0; return c == std::partial_ordering::greater; } +-A bool f24 (double i) { auto c = i <=> 5.0; return c != std::partial_ordering::greater; } +diff --git a/gcc/testsuite/g++.dg/opt/pr94589-3.C b/gcc/testsuite/g++.dg/opt/pr94589-3.C +deleted file mode 100644 +index 725b81f56..000000000 +--- a/gcc/testsuite/g++.dg/opt/pr94589-3.C ++++ /dev/null +@@ -1,84 +0,0 @@ +-// { dg-do run { target c++20 } } +-// { dg-options "-O2 -g" } +- +-#include "pr94589-1.C" +- +-#define C(fn, i, j, r) if (fn (i, j) != r) __builtin_abort () +-#define D(fn, i, r) if (fn (i) != r) __builtin_abort () +- +-int +-main () +-{ +- C (f1, 7, 8, false); +- C (f1, 8, 8, true); +- C (f1, 9, 8, false); +- C (f2, 7, 8, true); +- C (f2, 8, 8, false); +- C (f2, 9, 8, true); +- C (f3, 7, 8, false); +- C (f3, 8, 8, false); +- C (f3, 9, 8, true); +- C (f4, 7, 8, true); +- C (f4, 8, 8, false); +- C (f4, 9, 8, false); +- C (f5, 7, 8, false); +- C (f5, 8, 8, true); +- C (f5, 9, 8, true); +- C (f6, 7, 8, true); +- C (f6, 8, 8, true); +- C (f6, 9, 8, false); +- C (f7, 7, 8, true); +- C (f7, 8, 8, false); +- C (f7, 9, 8, false); +- C (f8, 7, 8, false); +- C (f8, 8, 8, true); +- C (f8, 9, 8, true); +- C (f9, 7, 8, false); +- C (f9, 8, 8, true); +- C (f9, 9, 8, false); +- C (f10, 7, 8, true); +- C (f10, 8, 8, false); +- C (f10, 9, 8, true); +- C (f11, 7, 8, false); +- C (f11, 8, 8, false); +- C (f11, 9, 8, true); +- C (f12, 7, 8, true); +- C (f12, 8, 8, true); +- C (f12, 9, 8, false); +- D (f13, 4, false); +- D (f13, 5, true); +- D (f13, 6, false); +- D (f14, 4, true); +- D (f14, 5, false); +- D (f14, 6, true); +- D (f15, 4, false); +- D (f15, 5, false); +- D (f15, 6, true); +- D (f16, 4, true); +- D (f16, 5, false); +- D (f16, 6, false); +- D (f17, 4, false); +- D (f17, 5, true); +- D (f17, 6, true); +- D (f18, 4, true); +- D (f18, 5, true); +- D (f18, 6, false); +- D (f19, 4, true); +- D (f19, 5, false); +- D (f19, 6, false); +- D (f20, 4, false); +- D (f20, 5, true); +- D (f20, 6, true); +- D (f21, 4, false); +- D (f21, 5, true); +- D (f21, 6, false); +- D (f22, 4, true); +- D (f22, 5, false); +- D (f22, 6, true); +- D (f23, 4, false); +- D (f23, 5, false); +- D (f23, 6, true); +- D (f24, 4, true); +- D (f24, 5, true); +- D (f24, 6, false); +-} +diff --git a/gcc/testsuite/g++.dg/opt/pr94589-4.C b/gcc/testsuite/g++.dg/opt/pr94589-4.C +deleted file mode 100644 +index 256a45580..000000000 +--- a/gcc/testsuite/g++.dg/opt/pr94589-4.C ++++ /dev/null +@@ -1,84 +0,0 @@ +-// { dg-do run { target c++20 } } +-// { dg-options "-O2 -g -ffast-math" } +- +-#include "pr94589-2.C" +- +-#define C(fn, i, j, r) if (fn (i, j) != r) __builtin_abort () +-#define D(fn, i, r) if (fn (i) != r) __builtin_abort () +- +-int +-main () +-{ +- C (f1, 7.0, 8.0, false); +- C (f1, 8.0, 8.0, true); +- C (f1, 9.0, 8.0, false); +- C (f2, 7.0, 8.0, true); +- C (f2, 8.0, 8.0, false); +- C (f2, 9.0, 8.0, true); +- C (f3, 7.0, 8.0, false); +- C (f3, 8.0, 8.0, false); +- C (f3, 9.0, 8.0, true); +- C (f4, 7.0, 8.0, true); +- C (f4, 8.0, 8.0, false); +- C (f4, 9.0, 8.0, false); +- C (f5, 7.0, 8.0, false); +- C (f5, 8.0, 8.0, true); +- C (f5, 9.0, 8.0, true); +- C (f6, 7.0, 8.0, true); +- C (f6, 8.0, 8.0, true); +- C (f6, 9.0, 8.0, false); +- C (f7, 7.0, 8.0, true); +- C (f7, 8.0, 8.0, false); +- C (f7, 9.0, 8.0, false); +- C (f8, 7.0, 8.0, false); +- C (f8, 8.0, 8.0, true); +- C (f8, 9.0, 8.0, true); +- C (f9, 7.0, 8.0, false); +- C (f9, 8.0, 8.0, true); +- C (f9, 9.0, 8.0, false); +- C (f10, 7.0, 8.0, true); +- C (f10, 8.0, 8.0, false); +- C (f10, 9.0, 8.0, true); +- C (f11, 7.0, 8.0, false); +- C (f11, 8.0, 8.0, false); +- C (f11, 9.0, 8.0, true); +- C (f12, 7.0, 8.0, true); +- C (f12, 8.0, 8.0, true); +- C (f12, 9.0, 8.0, false); +- D (f13, 4.0, false); +- D (f13, 5.0, true); +- D (f13, 6.0, false); +- D (f14, 4.0, true); +- D (f14, 5.0, false); +- D (f14, 6.0, true); +- D (f15, 4.0, false); +- D (f15, 5.0, false); +- D (f15, 6.0, true); +- D (f16, 4.0, true); +- D (f16, 5.0, false); +- D (f16, 6.0, false); +- D (f17, 4.0, false); +- D (f17, 5.0, true); +- D (f17, 6.0, true); +- D (f18, 4.0, true); +- D (f18, 5.0, true); +- D (f18, 6.0, false); +- D (f19, 4.0, true); +- D (f19, 5.0, false); +- D (f19, 6.0, false); +- D (f20, 4.0, false); +- D (f20, 5.0, true); +- D (f20, 6.0, true); +- D (f21, 4.0, false); +- D (f21, 5.0, true); +- D (f21, 6.0, false); +- D (f22, 4.0, true); +- D (f22, 5.0, false); +- D (f22, 6.0, true); +- D (f23, 4.0, false); +- D (f23, 5.0, false); +- D (f23, 6.0, true); +- D (f24, 4.0, true); +- D (f24, 5.0, true); +- D (f24, 6.0, false); +-} +diff --git a/gcc/testsuite/g++.dg/tree-ssa/mull64.C b/gcc/testsuite/g++.dg/tree-ssa/mull64.C +deleted file mode 100644 +index cad891e62..000000000 +--- a/gcc/testsuite/g++.dg/tree-ssa/mull64.C ++++ /dev/null +@@ -1,35 +0,0 @@ +-/* { dg-do compile } */ +-/* { dg-options "-O2 -fmerge-mull -Wno-psabi -fdump-tree-forwprop1-details -fdump-tree-forwprop4-details" } */ +- +-# define BN_BITS4 32 +-# define BN_MASK2 (0xffffffffffffffffL) +-# define BN_MASK2l (0xffffffffL) +-# define BN_MASK2h (0xffffffff00000000L) +-# define BN_MASK2h1 (0xffffffff80000000L) +-# define LBITS(a) ((a)&BN_MASK2l) +-# define HBITS(a) (((a)>>BN_BITS4)&BN_MASK2l) +-# define L2HBITS(a) (((a)<>BN_BITS4)&BN_MASK2l) +-# define L2HBITS(a) (((a)<|>=) \[ij]_\[0-9]+\\(D\\)" 14 "optimized" } } */ +-/* { dg-final { scan-tree-dump-times "i_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) \[45]" 14 "optimized" } } */ +- +-#define A __attribute__((noipa)) +-A int f1 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c == 0; } +-A int f2 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c != 0; } +-A int f3 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c > 0; } +-A int f4 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c < 0; } +-A int f5 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c >= 0; } +-A int f6 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c <= 0; } +-A int f7 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c == -1; } +-A int f8 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c != -1; } +-A int f9 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c > -1; } +-A int f10 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c <= -1; } +-A int f11 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c == 1; } +-A int f12 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c != 1; } +-A int f13 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c < 1; } +-A int f14 (int i, int j) { int c = i == j ? 0 : i < j ? -1 : 1; return c >= 1; } +-A int f15 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c == 0; } +-A int f16 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c != 0; } +-A int f17 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c > 0; } +-A int f18 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c < 0; } +-A int f19 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c >= 0; } +-A int f20 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c <= 0; } +-A int f21 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c == -1; } +-A int f22 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c != -1; } +-A int f23 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c > -1; } +-A int f24 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c <= -1; } +-A int f25 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c == 1; } +-A int f26 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c != 1; } +-A int f27 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c < 1; } +-A int f28 (int i) { int c = i == 5 ? 0 : i < 5 ? -1 : 1; return c >= 1; } +diff --git a/gcc/testsuite/gcc.dg/pr94589-2.c b/gcc/testsuite/gcc.dg/pr94589-2.c +deleted file mode 100644 +index 9481b764d..000000000 +--- a/gcc/testsuite/gcc.dg/pr94589-2.c ++++ /dev/null +@@ -1,35 +0,0 @@ +-/* PR tree-optimization/94589 */ +-/* { dg-do compile } */ +-/* { dg-options "-O2 -g0 -ffast-math -fdump-tree-optimized" } */ +-/* { dg-final { scan-tree-dump-times "\[ij]_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) \[ij]_\[0-9]+\\(D\\)" 14 "optimized" } } */ +-/* { dg-final { scan-tree-dump-times "i_\[0-9]+\\(D\\) (?:<|<=|==|!=|>|>=) 5\\.0" 14 "optimized" } } */ +- +-#define A __attribute__((noipa)) +-A int f1 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c == 0; } +-A int f2 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c != 0; } +-A int f3 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c > 0; } +-A int f4 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c < 0; } +-A int f5 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c >= 0; } +-A int f6 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c <= 0; } +-A int f7 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c == -1; } +-A int f8 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c != -1; } +-A int f9 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c > -1; } +-A int f10 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c <= -1; } +-A int f11 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c == 1; } +-A int f12 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c != 1; } +-A int f13 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c < 1; } +-A int f14 (double i, double j) { int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; return c >= 1; } +-A int f15 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c == 0; } +-A int f16 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c != 0; } +-A int f17 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c > 0; } +-A int f18 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c < 0; } +-A int f19 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c >= 0; } +-A int f20 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c <= 0; } +-A int f21 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c == -1; } +-A int f22 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c != -1; } +-A int f23 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c > -1; } +-A int f24 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c <= -1; } +-A int f25 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c == 1; } +-A int f26 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c != 1; } +-A int f27 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c < 1; } +-A int f28 (double i) { int c; if (i == 5.0) c = 0; else if (i < 5.0) c = -1; else if (i > 5.0) c = 1; else c = 2; return c >= 1; } +diff --git a/gcc/testsuite/gcc.dg/pr94589-3.c b/gcc/testsuite/gcc.dg/pr94589-3.c +deleted file mode 100644 +index df82fab73..000000000 +--- a/gcc/testsuite/gcc.dg/pr94589-3.c ++++ /dev/null +@@ -1,97 +0,0 @@ +-/* { dg-do run } */ +-/* { dg-options "-O2 -g" } */ +- +-#include "pr94589-1.c" +- +-#define C(fn, i, j, r) if (fn (i, j) != r) __builtin_abort () +-#define D(fn, i, r) if (fn (i) != r) __builtin_abort () +- +-int +-main () +-{ +- C (f1, 7, 8, 0); +- C (f1, 8, 8, 1); +- C (f1, 9, 8, 0); +- C (f2, 7, 8, 1); +- C (f2, 8, 8, 0); +- C (f2, 9, 8, 1); +- C (f3, 7, 8, 0); +- C (f3, 8, 8, 0); +- C (f3, 9, 8, 1); +- C (f4, 7, 8, 1); +- C (f4, 8, 8, 0); +- C (f4, 9, 8, 0); +- C (f5, 7, 8, 0); +- C (f5, 8, 8, 1); +- C (f5, 9, 8, 1); +- C (f6, 7, 8, 1); +- C (f6, 8, 8, 1); +- C (f6, 9, 8, 0); +- C (f7, 7, 8, 1); +- C (f7, 8, 8, 0); +- C (f7, 9, 8, 0); +- C (f8, 7, 8, 0); +- C (f8, 8, 8, 1); +- C (f8, 9, 8, 1); +- C (f9, 7, 8, 0); +- C (f9, 8, 8, 1); +- C (f9, 9, 8, 1); +- C (f10, 7, 8, 1); +- C (f10, 8, 8, 0); +- C (f10, 9, 8, 0); +- C (f11, 7, 8, 0); +- C (f11, 8, 8, 0); +- C (f11, 9, 8, 1); +- C (f12, 7, 8, 1); +- C (f12, 8, 8, 1); +- C (f12, 9, 8, 0); +- C (f13, 7, 8, 1); +- C (f13, 8, 8, 1); +- C (f13, 9, 8, 0); +- C (f14, 7, 8, 0); +- C (f14, 8, 8, 0); +- C (f14, 9, 8, 1); +- D (f15, 4, 0); +- D (f15, 5, 1); +- D (f15, 6, 0); +- D (f16, 4, 1); +- D (f16, 5, 0); +- D (f16, 6, 1); +- D (f17, 4, 0); +- D (f17, 5, 0); +- D (f17, 6, 1); +- D (f18, 4, 1); +- D (f18, 5, 0); +- D (f18, 6, 0); +- D (f19, 4, 0); +- D (f19, 5, 1); +- D (f19, 6, 1); +- D (f20, 4, 1); +- D (f20, 5, 1); +- D (f20, 6, 0); +- D (f21, 4, 1); +- D (f21, 5, 0); +- D (f21, 6, 0); +- D (f22, 4, 0); +- D (f22, 5, 1); +- D (f22, 6, 1); +- D (f23, 4, 0); +- D (f23, 5, 1); +- D (f23, 6, 1); +- D (f24, 4, 1); +- D (f24, 5, 0); +- D (f24, 6, 0); +- D (f25, 4, 0); +- D (f25, 5, 0); +- D (f25, 6, 1); +- D (f26, 4, 1); +- D (f26, 5, 1); +- D (f26, 6, 0); +- D (f27, 4, 1); +- D (f27, 5, 1); +- D (f27, 6, 0); +- D (f28, 4, 0); +- D (f28, 5, 0); +- D (f28, 6, 1); +- return 0; +-} +diff --git a/gcc/testsuite/gcc.dg/pr94589-4.c b/gcc/testsuite/gcc.dg/pr94589-4.c +deleted file mode 100644 +index b2557fb07..000000000 +--- a/gcc/testsuite/gcc.dg/pr94589-4.c ++++ /dev/null +@@ -1,97 +0,0 @@ +-/* { dg-do run } */ +-/* { dg-options "-O2 -g -ffast-math" } */ +- +-#include "pr94589-2.c" +- +-#define C(fn, i, j, r) if (fn (i, j) != r) __builtin_abort () +-#define D(fn, i, r) if (fn (i) != r) __builtin_abort () +- +-int +-main () +-{ +- C (f1, 7.0, 8.0, 0); +- C (f1, 8.0, 8.0, 1); +- C (f1, 9.0, 8.0, 0); +- C (f2, 7.0, 8.0, 1); +- C (f2, 8.0, 8.0, 0); +- C (f2, 9.0, 8.0, 1); +- C (f3, 7.0, 8.0, 0); +- C (f3, 8.0, 8.0, 0); +- C (f3, 9.0, 8.0, 1); +- C (f4, 7.0, 8.0, 1); +- C (f4, 8.0, 8.0, 0); +- C (f4, 9.0, 8.0, 0); +- C (f5, 7.0, 8.0, 0); +- C (f5, 8.0, 8.0, 1); +- C (f5, 9.0, 8.0, 1); +- C (f6, 7.0, 8.0, 1); +- C (f6, 8.0, 8.0, 1); +- C (f6, 9.0, 8.0, 0); +- C (f7, 7.0, 8.0, 1); +- C (f7, 8.0, 8.0, 0); +- C (f7, 9.0, 8.0, 0); +- C (f8, 7.0, 8.0, 0); +- C (f8, 8.0, 8.0, 1); +- C (f8, 9.0, 8.0, 1); +- C (f9, 7.0, 8.0, 0); +- C (f9, 8.0, 8.0, 1); +- C (f9, 9.0, 8.0, 1); +- C (f10, 7.0, 8.0, 1); +- C (f10, 8.0, 8.0, 0); +- C (f10, 9.0, 8.0, 0); +- C (f11, 7.0, 8.0, 0); +- C (f11, 8.0, 8.0, 0); +- C (f11, 9.0, 8.0, 1); +- C (f12, 7.0, 8.0, 1); +- C (f12, 8.0, 8.0, 1); +- C (f12, 9.0, 8.0, 0); +- C (f13, 7.0, 8.0, 1); +- C (f13, 8.0, 8.0, 1); +- C (f13, 9.0, 8.0, 0); +- C (f14, 7.0, 8.0, 0); +- C (f14, 8.0, 8.0, 0); +- C (f14, 9.0, 8.0, 1); +- D (f15, 4.0, 0); +- D (f15, 5.0, 1); +- D (f15, 6.0, 0); +- D (f16, 4.0, 1); +- D (f16, 5.0, 0); +- D (f16, 6.0, 1); +- D (f17, 4.0, 0); +- D (f17, 5.0, 0); +- D (f17, 6.0, 1); +- D (f18, 4.0, 1); +- D (f18, 5.0, 0); +- D (f18, 6.0, 0); +- D (f19, 4.0, 0); +- D (f19, 5.0, 1); +- D (f19, 6.0, 1); +- D (f20, 4.0, 1); +- D (f20, 5.0, 1); +- D (f20, 6.0, 0); +- D (f21, 4.0, 1); +- D (f21, 5.0, 0); +- D (f21, 6.0, 0); +- D (f22, 4.0, 0); +- D (f22, 5.0, 1); +- D (f22, 6.0, 1); +- D (f23, 4.0, 0); +- D (f23, 5.0, 1); +- D (f23, 6.0, 1); +- D (f24, 4.0, 1); +- D (f24, 5.0, 0); +- D (f24, 6.0, 0); +- D (f25, 4.0, 0); +- D (f25, 5.0, 0); +- D (f25, 6.0, 1); +- D (f26, 4.0, 1); +- D (f26, 5.0, 1); +- D (f26, 6.0, 0); +- D (f27, 4.0, 1); +- D (f27, 5.0, 1); +- D (f27, 6.0, 0); +- D (f28, 4.0, 0); +- D (f28, 5.0, 0); +- D (f28, 6.0, 1); +- return 0; +-} +diff --git a/gcc/testsuite/gcc.dg/pr97238.c b/gcc/testsuite/gcc.dg/pr97238.c +deleted file mode 100644 +index 746e93a97..000000000 +--- a/gcc/testsuite/gcc.dg/pr97238.c ++++ /dev/null +@@ -1,12 +0,0 @@ +-/* { dg-do compile } */ +-/* { dg-options "-O -Wno-psabi -w" } */ +- +-typedef int __attribute__ ((__vector_size__ (8))) V; +-int b, c, e; +-V d; +- +-V +-foo (void) +-{ +- return (b || e) | c > d | ((b || e) | c > d); +-} +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c +index b04316d55..364ce6a69 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-phiopt2-details" } */ ++/* { dg-options "-O1 -fdump-tree-phiopt2-details" } */ + + int t( int i) + { +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c +index 892654108..401357f2f 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + int f(_Bool x) + { +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c +index 5ead90f06..add9cca1e 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + int f(_Bool x) + { +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c +index 7b678fafc..4c190e6af 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + int nem1_phi (unsigned long a) { return a ? -1 : 0; } + int eqm1_phi (unsigned long a) { return a ? 0 : -1; } +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-22.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-22.c +index 23b679644..fd3706666 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-22.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-22.c +@@ -1,6 +1,6 @@ + /* PR tree-optimization/97690 */ + /* { dg-do compile } */ +-/* { dg-options "-O2 -ftree-fold-phiopt -fdump-tree-phiopt2" } */ ++/* { dg-options "-O2 -fdump-tree-phiopt2" } */ + + int foo (_Bool d) { return d ? 2 : 0; } + int bar (_Bool d) { return d ? 1 : 0; } +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-25.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-25.c +deleted file mode 100644 +index c52c92e1d..000000000 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-25.c ++++ /dev/null +@@ -1,83 +0,0 @@ +-/* { dg-do compile } */ +-/* { dg-options "-O2 -fdump-tree-optimized" } */ +- +-unsigned short test_bswap16(unsigned short x) +-{ +- return x ? __builtin_bswap16(x) : 0; +-} +- +-unsigned int test_bswap32(unsigned int x) +-{ +- return x ? __builtin_bswap32(x) : 0; +-} +- +-unsigned long long test_bswap64(unsigned long long x) +-{ +- return x ? __builtin_bswap64(x) : 0; +-} +- +-int test_clrsb(int x) +-{ +- return x ? __builtin_clrsb(x) : (__SIZEOF_INT__*8-1); +-} +- +-int test_clrsbl(long x) +-{ +- return x ? __builtin_clrsbl(x) : (__SIZEOF_LONG__*8-1); +-} +- +-int test_clrsbll(long long x) +-{ +- return x ? __builtin_clrsbll(x) : (__SIZEOF_LONG_LONG__*8-1); +-} +- +-#if 0 +-/* BUILT_IN_FFS is transformed by match.pd */ +-int test_ffs(unsigned int x) +-{ +- return x ? __builtin_ffs(x) : 0; +-} +- +-int test_ffsl(unsigned long x) +-{ +- return x ? __builtin_ffsl(x) : 0; +-} +- +-int test_ffsll(unsigned long long x) +-{ +- return x ? __builtin_ffsll(x) : 0; +-} +-#endif +- +-int test_parity(int x) +-{ +- return x ? __builtin_parity(x) : 0; +-} +- +-int test_parityl(long x) +-{ +- return x ? __builtin_parityl(x) : 0; +-} +- +-int test_parityll(long long x) +-{ +- return x ? __builtin_parityll(x) : 0; +-} +- +-int test_popcount(int x) +-{ +- return x ? __builtin_popcount(x) : 0; +-} +- +-int test_popcountl(long x) +-{ +- return x ? __builtin_popcountl(x) : 0; +-} +- +-int test_popcountll(long long x) +-{ +- return x ? __builtin_popcountll(x) : 0; +-} +- +-/* { dg-final { scan-tree-dump-not "goto" "optimized" } } */ +- +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c +index 4efd9afc4..3bdb85609 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + _Bool t(); + _Bool t1(); +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c +index 60dcc6733..18ecbd52a 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + int g(int,int); + int f(int t, int c) +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c +index aaa71a317..98c596b6a 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O -ftree-fold-phiopt -fdump-tree-optimized -fdump-tree-phiopt2" } */ ++/* { dg-options "-O -fdump-tree-optimized -fdump-tree-phiopt2" } */ + + int g(int,int); + int f(int t, int c) +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c +index efb1907cf..cd40ab2c1 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O1 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O1 -fdump-tree-optimized" } */ + + int foo (int a) + { +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c +index 8c8ada905..8f5ae5127 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O2 -ftree-fold-phiopt -fdump-tree-optimized" } */ ++/* { dg-options "-O2 -fdump-tree-optimized" } */ + + int test(int v) + { +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr96928-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr96928-1.c +index 88c13806a..2e86620da 100644 +--- a/gcc/testsuite/gcc.dg/tree-ssa/pr96928-1.c ++++ b/gcc/testsuite/gcc.dg/tree-ssa/pr96928-1.c +@@ -1,6 +1,6 @@ + /* PR tree-optimization/96928 */ + /* { dg-do compile } */ +-/* { dg-options "-O2 -ftree-fold-phiopt -fdump-tree-phiopt2 -fdump-tree-optimized" } */ ++/* { dg-options "-O2 -fdump-tree-phiopt2 -fdump-tree-optimized" } */ + /* { dg-final { scan-tree-dump-times " = a_\[0-9]*\\\(D\\\) >> " 5 "phiopt2" } } */ + /* { dg-final { scan-tree-dump-times " = ~c_\[0-9]*\\\(D\\\);" 1 "phiopt2" } } */ + /* { dg-final { scan-tree-dump-times " = ~" 1 "optimized" } } */ +diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr97503.c b/gcc/testsuite/gcc.dg/tree-ssa/pr97503.c +deleted file mode 100644 +index 3a3dae6c7..000000000 +--- a/gcc/testsuite/gcc.dg/tree-ssa/pr97503.c ++++ /dev/null +@@ -1,19 +0,0 @@ +-/* PR tree-optimization/97503 */ +-/* { dg-do compile } */ +-/* { dg-options "-O2 -fdump-tree-optimized" } */ +-/* { dg-additional-options "-mbmi -mlzcnt" { target i?86-*-* x86_64-*-* } } */ +-/* { dg-final { scan-tree-dump-times "\.CLZ" 2 "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-* } && lp64 } } } } */ +-/* { dg-final { scan-tree-dump-not "__builtin_clz" "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-*} && lp64 } } } } */ +-/* { dg-final { scan-tree-dump-not "PHI <" "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-*} && lp64 } } } } */ +- +-int +-foo (int x) +-{ +- return x ? __builtin_clz (x) : 32; +-} +- +-int +-bar (unsigned long long x) +-{ +- return x ? __builtin_clzll (x) : 64; +-} +diff --git a/gcc/tree-core.h b/gcc/tree-core.h +index 058e046aa..eb01c2434 100644 +--- a/gcc/tree-core.h ++++ b/gcc/tree-core.h +@@ -600,7 +600,6 @@ enum tree_index { + TI_UINT16_TYPE, + TI_UINT32_TYPE, + TI_UINT64_TYPE, +- TI_UINT128_TYPE, + + TI_VOID, + +diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c +index dcdf10369..952fd9cd4 100644 +--- a/gcc/tree-ssa-ccp.c ++++ b/gcc/tree-ssa-ccp.c +@@ -2005,7 +2005,6 @@ evaluate_stmt (gimple *stmt) + case BUILT_IN_BSWAP16: + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: +- case BUILT_IN_BSWAP128: + val = get_value_for_expr (gimple_call_arg (stmt, 0), true); + if (val.lattice_val == UNDEFINED) + break; +diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c +index 535dfc70a..3cf9f77c4 100644 +--- a/gcc/tree-ssa-phiopt.c ++++ b/gcc/tree-ssa-phiopt.c +@@ -48,14 +48,12 @@ along with GCC; see the file COPYING3. If not see + #include "case-cfn-macros.h" + #include "tree-eh.h" + #include "gimple-fold.h" +-#include "internal-fn.h" +-#include "gimple-match.h" + + static unsigned int tree_ssa_phiopt_worker (bool, bool, bool); + static bool two_value_replacement (basic_block, basic_block, edge, gphi *, + tree, tree); + static bool match_simplify_replacement (basic_block, basic_block, +- edge, edge, gphi *, tree, tree, bool); ++ edge, edge, gphi *, tree, tree); + static gphi *factor_out_conditional_conversion (edge, edge, gphi *, tree, tree, + gimple *); + static int value_replacement (basic_block, basic_block, +@@ -64,11 +62,8 @@ static bool minmax_replacement (basic_block, basic_block, + edge, edge, gphi *, tree, tree); + static bool abs_replacement (basic_block, basic_block, + edge, edge, gphi *, tree, tree); +-static bool spaceship_replacement (basic_block, basic_block, +- edge, edge, gphi *, tree, tree); +-static bool cond_removal_in_builtin_zero_pattern (basic_block, basic_block, +- edge, edge, gphi *, +- tree, tree); ++static bool cond_removal_in_popcount_pattern (basic_block, basic_block, ++ edge, edge, gphi *, tree, tree); + static bool cond_store_replacement (basic_block, basic_block, edge, edge, + hash_set *); + static bool cond_if_else_store_replacement (basic_block, basic_block, basic_block); +@@ -348,20 +343,18 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p) + /* Do the replacement of conditional if it can be done. */ + if (!early_p && two_value_replacement (bb, bb1, e2, phi, arg0, arg1)) + cfgchanged = true; +- else if (match_simplify_replacement (bb, bb1, e1, e2, phi, +- arg0, arg1, +- early_p)) ++ else if (!early_p ++ && match_simplify_replacement (bb, bb1, e1, e2, phi, ++ arg0, arg1)) + cfgchanged = true; + else if (abs_replacement (bb, bb1, e1, e2, phi, arg0, arg1)) + cfgchanged = true; + else if (!early_p +- && cond_removal_in_builtin_zero_pattern (bb, bb1, e1, e2, +- phi, arg0, arg1)) ++ && cond_removal_in_popcount_pattern (bb, bb1, e1, e2, ++ phi, arg0, arg1)) + cfgchanged = true; + else if (minmax_replacement (bb, bb1, e1, e2, phi, arg0, arg1)) + cfgchanged = true; +- else if (spaceship_replacement (bb, bb1, e1, e2, phi, arg0, arg1)) +- cfgchanged = true; + } + } + +@@ -759,67 +752,6 @@ two_value_replacement (basic_block cond_bb, basic_block middle_bb, + return true; + } + +-/* Return TRUE if CODE should be allowed during early phiopt. +- Currently this is to allow MIN/MAX and ABS/NEGATE. */ +-static bool +-phiopt_early_allow (enum tree_code code) +-{ +- switch (code) +- { +- case MIN_EXPR: +- case MAX_EXPR: +- case ABS_EXPR: +- case ABSU_EXPR: +- case NEGATE_EXPR: +- case SSA_NAME: +- return true; +- default: +- return false; +- } +-} +- +-/* gimple_simplify_phiopt is like gimple_simplify but designed for PHIOPT. +- Return NULL if nothing can be simplified or the resulting simplified value +- with parts pushed if EARLY_P was true. Also rejects non allowed tree code +- if EARLY_P is set. +- Takes the comparison from COMP_STMT and two args, ARG0 and ARG1 and tries +- to simplify CMP ? ARG0 : ARG1. */ +-static tree +-gimple_simplify_phiopt (bool early_p, tree type, gimple *comp_stmt, +- tree arg0, tree arg1, +- gimple_seq *seq) +-{ +- tree result; +- enum tree_code comp_code = gimple_cond_code (comp_stmt); +- location_t loc = gimple_location (comp_stmt); +- tree cmp0 = gimple_cond_lhs (comp_stmt); +- tree cmp1 = gimple_cond_rhs (comp_stmt); +- /* To handle special cases like floating point comparison, it is easier and +- less error-prone to build a tree and gimplify it on the fly though it is +- less efficient. +- Don't use fold_build2 here as that might create (bool)a instead of just +- "a != 0". */ +- tree cond = build2_loc (loc, comp_code, boolean_type_node, +- cmp0, cmp1); +- gimple_match_op op (gimple_match_cond::UNCOND, +- COND_EXPR, type, cond, arg0, arg1); +- +- if (op.resimplify (early_p ? NULL : seq, follow_all_ssa_edges)) +- { +- /* Early we want only to allow some generated tree codes. */ +- if (!early_p +- || op.code.is_tree_code () +- || phiopt_early_allow ((tree_code)op.code)) +- { +- result = maybe_push_res_to_seq (&op, seq); +- if (result) +- return result; +- } +- } +- +- return NULL; +-} +- + /* The function match_simplify_replacement does the main work of doing the + replacement using match and simplify. Return true if the replacement is done. + Otherwise return false. +@@ -829,18 +761,16 @@ gimple_simplify_phiopt (bool early_p, tree type, gimple *comp_stmt, + static bool + match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, + edge e0, edge e1, gphi *phi, +- tree arg0, tree arg1, bool early_p) ++ tree arg0, tree arg1) + { + gimple *stmt; ++ tree cond; + gimple_stmt_iterator gsi; + edge true_edge, false_edge; + gimple_seq seq = NULL; + tree result; + gimple *stmt_to_move = NULL; + +- if (!flag_fold_phiopt) +- return false; +- + /* Special case A ? B : B as this will always simplify to B. */ + if (operand_equal_for_phi_arg_p (arg0, arg1)) + return false; +@@ -895,6 +825,15 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, + + stmt = last_stmt (cond_bb); + ++ /* To handle special cases like floating point comparison, it is easier and ++ less error-prone to build a tree and gimplify it on the fly though it is ++ less efficient. ++ Don't use fold_build2 here as that might create (bool)a instead of just ++ "a != 0". */ ++ cond = build2_loc (gimple_location (stmt), ++ gimple_cond_code (stmt), boolean_type_node, ++ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt)); ++ + /* We need to know which is the true edge and which is the false + edge so that we know when to invert the condition below. */ + extract_true_false_edges_from_block (cond_bb, &true_edge, &false_edge); +@@ -902,9 +841,10 @@ match_simplify_replacement (basic_block cond_bb, basic_block middle_bb, + std::swap (arg0, arg1); + + tree type = TREE_TYPE (gimple_phi_result (phi)); +- result = gimple_simplify_phiopt (early_p, type, stmt, +- arg0, arg1, +- &seq); ++ result = gimple_simplify (COND_EXPR, type, ++ cond, ++ arg0, arg1, ++ &seq, NULL); + if (!result) + return false; + +@@ -1786,428 +1726,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, + return true; + } + +-/* Return true if the only executable statement in BB is a GIMPLE_COND. */ +- +-static bool +-cond_only_block_p (basic_block bb) +-{ +- /* BB must have no executable statements. */ +- gimple_stmt_iterator gsi = gsi_after_labels (bb); +- if (phi_nodes (bb)) +- return false; +- while (!gsi_end_p (gsi)) +- { +- gimple *stmt = gsi_stmt (gsi); +- if (is_gimple_debug (stmt)) +- ; +- else if (gimple_code (stmt) == GIMPLE_NOP +- || gimple_code (stmt) == GIMPLE_PREDICT +- || gimple_code (stmt) == GIMPLE_COND) +- ; +- else +- return false; +- gsi_next (&gsi); +- } +- return true; +-} +- +-/* Attempt to optimize (x <=> y) cmp 0 and similar comparisons. +- For strong ordering <=> try to match something like: +- : // cond3_bb (== cond2_bb) +- if (x_4(D) != y_5(D)) +- goto ; [INV] +- else +- goto ; [INV] +- +- : // cond_bb +- if (x_4(D) < y_5(D)) +- goto ; [INV] +- else +- goto ; [INV] +- +- : // middle_bb +- +- : // phi_bb +- # iftmp.0_2 = PHI <1(4), 0(2), -1(3)> +- _1 = iftmp.0_2 == 0; +- +- and for partial ordering <=> something like: +- +- : // cond3_bb +- if (a_3(D) == b_5(D)) +- goto ; [50.00%] +- else +- goto ; [50.00%] +- +- [local count: 536870913]: // cond2_bb +- if (a_3(D) < b_5(D)) +- goto ; [50.00%] +- else +- goto ; [50.00%] +- +- [local count: 268435456]: // cond_bb +- if (a_3(D) > b_5(D)) +- goto ; [50.00%] +- else +- goto ; [50.00%] +- +- [local count: 134217728]: // middle_bb +- +- [local count: 1073741824]: // phi_bb +- # SR.27_4 = PHI <0(2), -1(3), 1(4), 2(5)> +- _2 = SR.27_4 > 0; */ +- +-static bool +-spaceship_replacement (basic_block cond_bb, basic_block middle_bb, +- edge e0, edge e1, gphi *phi, +- tree arg0, tree arg1) +-{ +- if (!INTEGRAL_TYPE_P (TREE_TYPE (PHI_RESULT (phi))) +- || TYPE_UNSIGNED (TREE_TYPE (PHI_RESULT (phi))) +- || !tree_fits_shwi_p (arg0) +- || !tree_fits_shwi_p (arg1) +- || !IN_RANGE (tree_to_shwi (arg0), -1, 2) +- || !IN_RANGE (tree_to_shwi (arg1), -1, 2)) +- return false; +- +- basic_block phi_bb = gimple_bb (phi); +- gcc_assert (phi_bb == e0->dest && phi_bb == e1->dest); +- if (!IN_RANGE (EDGE_COUNT (phi_bb->preds), 3, 4)) +- return false; +- +- use_operand_p use_p; +- gimple *use_stmt; +- if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi))) +- return false; +- if (!single_imm_use (PHI_RESULT (phi), &use_p, &use_stmt)) +- return false; +- enum tree_code cmp; +- tree lhs, rhs; +- if (gimple_code (use_stmt) == GIMPLE_COND) +- { +- cmp = gimple_cond_code (use_stmt); +- lhs = gimple_cond_lhs (use_stmt); +- rhs = gimple_cond_rhs (use_stmt); +- } +- else if (is_gimple_assign (use_stmt)) +- { +- if (gimple_assign_rhs_class (use_stmt) == GIMPLE_BINARY_RHS) +- { +- cmp = gimple_assign_rhs_code (use_stmt); +- lhs = gimple_assign_rhs1 (use_stmt); +- rhs = gimple_assign_rhs2 (use_stmt); +- } +- else if (gimple_assign_rhs_code (use_stmt) == COND_EXPR) +- { +- tree cond = gimple_assign_rhs1 (use_stmt); +- if (!COMPARISON_CLASS_P (cond)) +- return false; +- cmp = TREE_CODE (cond); +- lhs = TREE_OPERAND (cond, 0); +- rhs = TREE_OPERAND (cond, 1); +- } +- else +- return false; +- } +- else +- return false; +- switch (cmp) +- { +- case EQ_EXPR: +- case NE_EXPR: +- case LT_EXPR: +- case GT_EXPR: +- case LE_EXPR: +- case GE_EXPR: +- break; +- default: +- return false; +- } +- if (lhs != PHI_RESULT (phi) +- || !tree_fits_shwi_p (rhs) +- || !IN_RANGE (tree_to_shwi (rhs), -1, 1)) +- return false; +- +- if (!empty_block_p (middle_bb)) +- return false; +- +- gcond *cond1 = as_a (last_stmt (cond_bb)); +- enum tree_code cmp1 = gimple_cond_code (cond1); +- if (cmp1 != LT_EXPR && cmp1 != GT_EXPR) +- return false; +- tree lhs1 = gimple_cond_lhs (cond1); +- tree rhs1 = gimple_cond_rhs (cond1); +- /* The optimization may be unsafe due to NaNs. */ +- if (HONOR_NANS (TREE_TYPE (lhs1))) +- return false; +- if (TREE_CODE (lhs1) == SSA_NAME && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs1)) +- return false; +- if (TREE_CODE (rhs1) == SSA_NAME && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs1)) +- return false; +- +- if (!single_pred_p (cond_bb) || !cond_only_block_p (cond_bb)) +- return false; +- +- basic_block cond2_bb = single_pred (cond_bb); +- if (EDGE_COUNT (cond2_bb->succs) != 2) +- return false; +- edge cond2_phi_edge; +- if (EDGE_SUCC (cond2_bb, 0)->dest == cond_bb) +- { +- if (EDGE_SUCC (cond2_bb, 1)->dest != phi_bb) +- return false; +- cond2_phi_edge = EDGE_SUCC (cond2_bb, 1); +- } +- else if (EDGE_SUCC (cond2_bb, 0)->dest != phi_bb) +- return false; +- else +- cond2_phi_edge = EDGE_SUCC (cond2_bb, 0); +- tree arg2 = gimple_phi_arg_def (phi, cond2_phi_edge->dest_idx); +- if (!tree_fits_shwi_p (arg2)) +- return false; +- gimple *cond2 = last_stmt (cond2_bb); +- if (cond2 == NULL || gimple_code (cond2) != GIMPLE_COND) +- return false; +- enum tree_code cmp2 = gimple_cond_code (cond2); +- tree lhs2 = gimple_cond_lhs (cond2); +- tree rhs2 = gimple_cond_rhs (cond2); +- if (lhs2 == lhs1) +- { +- if (!operand_equal_p (rhs2, rhs1, 0)) +- return false; +- } +- else if (lhs2 == rhs1) +- { +- if (rhs2 != lhs1) +- return false; +- } +- else +- return false; +- +- tree arg3 = arg2; +- basic_block cond3_bb = cond2_bb; +- edge cond3_phi_edge = cond2_phi_edge; +- gimple *cond3 = cond2; +- enum tree_code cmp3 = cmp2; +- tree lhs3 = lhs2; +- tree rhs3 = rhs2; +- if (EDGE_COUNT (phi_bb->preds) == 4) +- { +- if (absu_hwi (tree_to_shwi (arg2)) != 1) +- return false; +- if (e1->flags & EDGE_TRUE_VALUE) +- { +- if (tree_to_shwi (arg0) != 2 +- || absu_hwi (tree_to_shwi (arg1)) != 1 +- || wi::to_widest (arg1) == wi::to_widest (arg2)) +- return false; +- } +- else if (tree_to_shwi (arg1) != 2 +- || absu_hwi (tree_to_shwi (arg0)) != 1 +- || wi::to_widest (arg0) == wi::to_widest (arg1)) +- return false; +- if (cmp2 != LT_EXPR && cmp2 != GT_EXPR) +- return false; +- /* if (x < y) goto phi_bb; else fallthru; +- if (x > y) goto phi_bb; else fallthru; +- bbx:; +- phi_bb:; +- is ok, but if x and y are swapped in one of the comparisons, +- or the comparisons are the same and operands not swapped, +- or second goto phi_bb is not the true edge, it is not. */ +- if ((lhs2 == lhs1) +- ^ (cmp2 == cmp1) +- ^ ((e1->flags & EDGE_TRUE_VALUE) != 0)) +- return false; +- if ((cond2_phi_edge->flags & EDGE_TRUE_VALUE) == 0) +- return false; +- if (!single_pred_p (cond2_bb) || !cond_only_block_p (cond2_bb)) +- return false; +- cond3_bb = single_pred (cond2_bb); +- if (EDGE_COUNT (cond2_bb->succs) != 2) +- return false; +- if (EDGE_SUCC (cond3_bb, 0)->dest == cond2_bb) +- { +- if (EDGE_SUCC (cond3_bb, 1)->dest != phi_bb) +- return false; +- cond3_phi_edge = EDGE_SUCC (cond3_bb, 1); +- } +- else if (EDGE_SUCC (cond3_bb, 0)->dest != phi_bb) +- return false; +- else +- cond3_phi_edge = EDGE_SUCC (cond3_bb, 0); +- arg3 = gimple_phi_arg_def (phi, cond3_phi_edge->dest_idx); +- cond3 = last_stmt (cond3_bb); +- if (cond3 == NULL || gimple_code (cond3) != GIMPLE_COND) +- return false; +- cmp3 = gimple_cond_code (cond3); +- lhs3 = gimple_cond_lhs (cond3); +- rhs3 = gimple_cond_rhs (cond3); +- if (lhs3 == lhs1) +- { +- if (!operand_equal_p (rhs3, rhs1, 0)) +- return false; +- } +- else if (lhs3 == rhs1) +- { +- if (rhs3 != lhs1) +- return false; +- } +- else +- return false; +- } +- else if (absu_hwi (tree_to_shwi (arg0)) != 1 +- || absu_hwi (tree_to_shwi (arg1)) != 1 +- || wi::to_widest (arg0) == wi::to_widest (arg1)) +- return false; +- +- if (!integer_zerop (arg3) || (cmp3 != EQ_EXPR && cmp3 != NE_EXPR)) +- return false; +- if ((cond3_phi_edge->flags & (cmp3 == EQ_EXPR +- ? EDGE_TRUE_VALUE : EDGE_FALSE_VALUE)) == 0) +- return false; +- +- /* lhs1 one_cmp rhs1 results in PHI_RESULT (phi) of 1. */ +- enum tree_code one_cmp; +- if ((cmp1 == LT_EXPR) +- ^ (!integer_onep ((e1->flags & EDGE_TRUE_VALUE) ? arg1 : arg0))) +- one_cmp = LT_EXPR; +- else +- one_cmp = GT_EXPR; +- +- enum tree_code res_cmp; +- switch (cmp) +- { +- case EQ_EXPR: +- if (integer_zerop (rhs)) +- res_cmp = EQ_EXPR; +- else if (integer_minus_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GT_EXPR : LT_EXPR; +- else if (integer_onep (rhs)) +- res_cmp = one_cmp; +- else +- return false; +- break; +- case NE_EXPR: +- if (integer_zerop (rhs)) +- res_cmp = NE_EXPR; +- else if (integer_minus_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? LE_EXPR : GE_EXPR; +- else if (integer_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GE_EXPR : LE_EXPR; +- else +- return false; +- break; +- case LT_EXPR: +- if (integer_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GE_EXPR : LE_EXPR; +- else if (integer_zerop (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GT_EXPR : LT_EXPR; +- else +- return false; +- break; +- case LE_EXPR: +- if (integer_zerop (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GE_EXPR : LE_EXPR; +- else if (integer_minus_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? GT_EXPR : LT_EXPR; +- else +- return false; +- break; +- case GT_EXPR: +- if (integer_minus_onep (rhs)) +- res_cmp = one_cmp == LT_EXPR ? LE_EXPR : GE_EXPR; +- else if (integer_zerop (rhs)) +- res_cmp = one_cmp; +- else +- return false; +- break; +- case GE_EXPR: +- if (integer_zerop (rhs)) +- res_cmp = one_cmp == LT_EXPR ? LE_EXPR : GE_EXPR; +- else if (integer_onep (rhs)) +- res_cmp = one_cmp; +- else +- return false; +- break; +- default: +- gcc_unreachable (); +- } +- +- if (gimple_code (use_stmt) == GIMPLE_COND) +- { +- gcond *use_cond = as_a (use_stmt); +- gimple_cond_set_code (use_cond, res_cmp); +- gimple_cond_set_lhs (use_cond, lhs1); +- gimple_cond_set_rhs (use_cond, rhs1); +- } +- else if (gimple_assign_rhs_class (use_stmt) == GIMPLE_BINARY_RHS) +- { +- gimple_assign_set_rhs_code (use_stmt, res_cmp); +- gimple_assign_set_rhs1 (use_stmt, lhs1); +- gimple_assign_set_rhs2 (use_stmt, rhs1); +- } +- else +- { +- tree cond = build2 (res_cmp, TREE_TYPE (gimple_assign_rhs1 (use_stmt)), +- lhs1, rhs1); +- gimple_assign_set_rhs1 (use_stmt, cond); +- } +- update_stmt (use_stmt); +- +- if (MAY_HAVE_DEBUG_BIND_STMTS) +- { +- use_operand_p use_p; +- imm_use_iterator iter; +- bool has_debug_uses = false; +- FOR_EACH_IMM_USE_FAST (use_p, iter, PHI_RESULT (phi)) +- { +- gimple *use_stmt = USE_STMT (use_p); +- gcc_assert (is_gimple_debug (use_stmt)); +- has_debug_uses = true; +- break; +- } +- +- if (has_debug_uses) +- { +- /* If there are debug uses, emit something like: +- # DEBUG D#1 => i_2(D) > j_3(D) ? 1 : -1 +- # DEBUG D#2 => i_2(D) == j_3(D) ? 0 : D#1 +- where > stands for the comparison that yielded 1 +- and replace debug uses of phi result with that D#2. +- Ignore the value of 2, because if NaNs aren't expected, +- all floating point numbers should be comparable. */ +- gimple_stmt_iterator gsi = gsi_after_labels (gimple_bb (phi)); +- tree type = TREE_TYPE (PHI_RESULT (phi)); +- tree temp1 = make_node (DEBUG_EXPR_DECL); +- DECL_ARTIFICIAL (temp1) = 1; +- TREE_TYPE (temp1) = type; +- SET_DECL_MODE (temp1, TYPE_MODE (type)); +- tree t = build2 (one_cmp, boolean_type_node, lhs1, rhs2); +- t = build3 (COND_EXPR, type, t, build_one_cst (type), +- build_int_cst (type, -1)); +- gimple *g = gimple_build_debug_bind (temp1, t, phi); +- gsi_insert_before (&gsi, g, GSI_SAME_STMT); +- tree temp2 = make_node (DEBUG_EXPR_DECL); +- DECL_ARTIFICIAL (temp2) = 1; +- TREE_TYPE (temp2) = type; +- SET_DECL_MODE (temp2, TYPE_MODE (type)); +- t = build2 (EQ_EXPR, boolean_type_node, lhs1, rhs2); +- t = build3 (COND_EXPR, type, t, build_zero_cst (type), temp1); +- g = gimple_build_debug_bind (temp2, t, phi); +- gsi_insert_before (&gsi, g, GSI_SAME_STMT); +- replace_uses_by (PHI_RESULT (phi), temp2); +- } +- } +- +- gimple_stmt_iterator psi = gsi_for_stmt (phi); +- remove_phi_node (&psi, true); +- +- return true; +-} +- +-/* Optimize x ? __builtin_fun (x) : C, where C is __builtin_fun (0). +- Convert ++/* Convert + + + if (b_4(D) != 0) +@@ -2233,20 +1752,16 @@ spaceship_replacement (basic_block cond_bb, basic_block middle_bb, + + + c_12 = PHI <_9(2)> +- +- Similarly for __builtin_clz or __builtin_ctz if +- C?Z_DEFINED_VALUE_AT_ZERO is 2, optab is present and +- instead of 0 above it uses the value from that macro. */ ++*/ + + static bool +-cond_removal_in_builtin_zero_pattern (basic_block cond_bb, +- basic_block middle_bb, +- edge e1, edge e2, gphi *phi, +- tree arg0, tree arg1) ++cond_removal_in_popcount_pattern (basic_block cond_bb, basic_block middle_bb, ++ edge e1, edge e2, ++ gphi *phi, tree arg0, tree arg1) + { + gimple *cond; + gimple_stmt_iterator gsi, gsi_from; +- gimple *call; ++ gimple *popcount; + gimple *cast = NULL; + tree lhs, arg; + +@@ -2264,82 +1779,35 @@ cond_removal_in_builtin_zero_pattern (basic_block cond_bb, + gsi_next_nondebug (&gsi); + if (!gsi_end_p (gsi)) + { +- call = gsi_stmt (gsi); ++ popcount = gsi_stmt (gsi); + gsi_next_nondebug (&gsi); + if (!gsi_end_p (gsi)) + return false; + } + else + { +- call = cast; ++ popcount = cast; + cast = NULL; + } + +- /* Check that we have a popcount/clz/ctz builtin. */ +- if (!is_gimple_call (call) || gimple_call_num_args (call) != 1) +- return false; +- +- arg = gimple_call_arg (call, 0); +- lhs = gimple_get_lhs (call); +- +- if (lhs == NULL_TREE) ++ /* Check that we have a popcount builtin. */ ++ if (!is_gimple_call (popcount)) + return false; +- +- combined_fn cfn = gimple_call_combined_fn (call); +- internal_fn ifn = IFN_LAST; +- int val = 0; ++ combined_fn cfn = gimple_call_combined_fn (popcount); + switch (cfn) + { +- case CFN_BUILT_IN_BSWAP16: +- case CFN_BUILT_IN_BSWAP32: +- case CFN_BUILT_IN_BSWAP64: +- case CFN_BUILT_IN_BSWAP128: +- CASE_CFN_FFS: +- CASE_CFN_PARITY: + CASE_CFN_POPCOUNT: + break; +- CASE_CFN_CLZ: +- if (INTEGRAL_TYPE_P (TREE_TYPE (arg))) +- { +- tree type = TREE_TYPE (arg); +- if (direct_internal_fn_supported_p (IFN_CLZ, type, OPTIMIZE_FOR_BOTH) +- && CLZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (type), +- val) == 2) +- { +- ifn = IFN_CLZ; +- break; +- } +- } +- return false; +- CASE_CFN_CTZ: +- if (INTEGRAL_TYPE_P (TREE_TYPE (arg))) +- { +- tree type = TREE_TYPE (arg); +- if (direct_internal_fn_supported_p (IFN_CTZ, type, OPTIMIZE_FOR_BOTH) +- && CTZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (type), +- val) == 2) +- { +- ifn = IFN_CTZ; +- break; +- } +- } +- return false; +- case BUILT_IN_CLRSB: +- val = TYPE_PRECISION (integer_type_node) - 1; +- break; +- case BUILT_IN_CLRSBL: +- val = TYPE_PRECISION (long_integer_type_node) - 1; +- break; +- case BUILT_IN_CLRSBLL: +- val = TYPE_PRECISION (long_long_integer_type_node) - 1; +- break; + default: + return false; + } + ++ arg = gimple_call_arg (popcount, 0); ++ lhs = gimple_get_lhs (popcount); ++ + if (cast) + { +- /* We have a cast stmt feeding popcount/clz/ctz builtin. */ ++ /* We have a cast stmt feeding popcount builtin. */ + /* Check that we have a cast prior to that. */ + if (gimple_code (cast) != GIMPLE_ASSIGN + || !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (cast))) +@@ -2352,7 +1820,7 @@ cond_removal_in_builtin_zero_pattern (basic_block cond_bb, + + cond = last_stmt (cond_bb); + +- /* Cond_bb has a check for b_4 [!=|==] 0 before calling the popcount/clz/ctz ++ /* Cond_bb has a check for b_4 [!=|==] 0 before calling the popcount + builtin. */ + if (gimple_code (cond) != GIMPLE_COND + || (gimple_cond_code (cond) != NE_EXPR +@@ -2372,13 +1840,10 @@ cond_removal_in_builtin_zero_pattern (basic_block cond_bb, + } + + /* Check PHI arguments. */ +- if (lhs != arg0 +- || TREE_CODE (arg1) != INTEGER_CST +- || wi::to_wide (arg1) != val) ++ if (lhs != arg0 || !integer_zerop (arg1)) + return false; + +- /* And insert the popcount/clz/ctz builtin and cast stmt before the +- cond_bb. */ ++ /* And insert the popcount builtin and cast stmt before the cond_bb. */ + gsi = gsi_last_bb (cond_bb); + if (cast) + { +@@ -2386,19 +1851,9 @@ cond_removal_in_builtin_zero_pattern (basic_block cond_bb, + gsi_move_before (&gsi_from, &gsi); + reset_flow_sensitive_info (gimple_get_lhs (cast)); + } +- gsi_from = gsi_for_stmt (call); +- if (ifn == IFN_LAST || gimple_call_internal_p (call)) +- gsi_move_before (&gsi_from, &gsi); +- else +- { +- /* For __builtin_c[lt]z* force .C[LT]Z ifn, because only +- the latter is well defined at zero. */ +- call = gimple_build_call_internal (ifn, 1, gimple_call_arg (call, 0)); +- gimple_call_set_lhs (call, lhs); +- gsi_insert_before (&gsi, call, GSI_SAME_STMT); +- gsi_remove (&gsi_from, true); +- } +- reset_flow_sensitive_info (lhs); ++ gsi_from = gsi_for_stmt (popcount); ++ gsi_move_before (&gsi_from, &gsi); ++ reset_flow_sensitive_info (gimple_get_lhs (popcount)); + + /* Now update the PHI and remove unneeded bbs. */ + replace_phi_edge_with_variable (cond_bb, e2, phi, lhs); +diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c +index 1ad43dba1..5f978ac78 100644 +--- a/gcc/tree-ssa-reassoc.c ++++ b/gcc/tree-ssa-reassoc.c +@@ -3839,7 +3839,7 @@ ovce_extract_ops (tree var, gassign **rets, bool *reti, tree *type, + gassign *stmt = dyn_cast (SSA_NAME_DEF_STMT (var)); + if (stmt == NULL) + return ERROR_MARK; +- if (vcond) ++ if (*vcond) + *vcond = stmt; + + /* ??? If we start creating more COND_EXPR, we could perform +@@ -3853,7 +3853,7 @@ ovce_extract_ops (tree var, gassign **rets, bool *reti, tree *type, + return ERROR_MARK; + + gassign *assign = dyn_cast (SSA_NAME_DEF_STMT (cond)); +- if (assign == NULL ++ if (stmt == NULL + || TREE_CODE_CLASS (gimple_assign_rhs_code (assign)) != tcc_comparison) + return ERROR_MARK; + +diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c +index 98b233718..fde1ceb60 100644 +--- a/gcc/tree-vect-stmts.c ++++ b/gcc/tree-vect-stmts.c +@@ -3266,7 +3266,7 @@ vect_get_data_ptr_increment (dr_vec_info *dr_info, tree aggr_type, + return iv_step; + } + +-/* Check and perform vectorization of BUILT_IN_BSWAP{16,32,64,128}. */ ++/* Check and perform vectorization of BUILT_IN_BSWAP{16,32,64}. */ + + static bool + vectorizable_bswap (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, +@@ -3635,8 +3635,7 @@ vectorizable_call (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, + else if (modifier == NONE + && (gimple_call_builtin_p (stmt, BUILT_IN_BSWAP16) + || gimple_call_builtin_p (stmt, BUILT_IN_BSWAP32) +- || gimple_call_builtin_p (stmt, BUILT_IN_BSWAP64) +- || gimple_call_builtin_p (stmt, BUILT_IN_BSWAP128))) ++ || gimple_call_builtin_p (stmt, BUILT_IN_BSWAP64))) + return vectorizable_bswap (stmt_info, gsi, vec_stmt, slp_node, + vectype_in, cost_vec); + else +diff --git a/gcc/tree.c b/gcc/tree.c +index a61788651..75a191f97 100644 +--- a/gcc/tree.c ++++ b/gcc/tree.c +@@ -10392,8 +10392,6 @@ build_common_tree_nodes (bool signed_char) + uint16_type_node = make_or_reuse_type (16, 1); + uint32_type_node = make_or_reuse_type (32, 1); + uint64_type_node = make_or_reuse_type (64, 1); +- if (targetm.scalar_mode_supported_p (TImode)) +- uint128_type_node = make_or_reuse_type (128, 1); + + /* Decimal float types. */ + if (targetm.decimal_float_supported_p ()) +diff --git a/gcc/tree.h b/gcc/tree.h +index c66207fa0..792d9c864 100644 +--- a/gcc/tree.h ++++ b/gcc/tree.h +@@ -4037,7 +4037,6 @@ tree_strip_any_location_wrapper (tree exp) + #define uint16_type_node global_trees[TI_UINT16_TYPE] + #define uint32_type_node global_trees[TI_UINT32_TYPE] + #define uint64_type_node global_trees[TI_UINT64_TYPE] +-#define uint128_type_node global_trees[TI_UINT128_TYPE] + + #define void_node global_trees[TI_VOID] + +-- +2.33.0 + diff --git a/gcc.spec b/gcc.spec index fb6676c..b1ea525 100644 --- a/gcc.spec +++ b/gcc.spec @@ -61,7 +61,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: 29 +Release: 30 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD URL: https://gcc.gnu.org @@ -229,6 +229,8 @@ Patch118: 0118-aarch64-Make-stack-smash-canary-protect-saved-registers.patch Patch119: 0119-ix86-Don-t-use-the-m-constraint-for-x86_64_general_o.patch Patch120: 0120-Backport-Fix-ICE-Don-t-generate-integer-mask-compari.patch Patch121: 0121-Strcut-Reorg-fix-spec2017-505-build-issue-with-fipa-.patch +Patch122: 0122-aarch64-Remove-XFAILs-for-two-SVE-tests.patch +Patch123: 0123-Revert-feature-mull64.patch %global gcc_target_platform %{_arch}-linux-gnu @@ -803,6 +805,8 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch119 -p1 %patch120 -p1 %patch121 -p1 +%patch122 -p1 +%patch123 -p1 %build @@ -2831,6 +2835,12 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Tue Jan 14 2025 huzife <634763349@qq.com> - 10.3.1-30 +- Type:Sync +- ID:NA +- SUG:NA +- DESC:Sync patch from openeuler/gcc revert feature mull64 + * Thu Aug 22 2024 wuxinghang - 10.3.1-29 - Type:Sync - ID:NA -- Gitee