[gcc r14-9423] Fix placement of recently implemented DIE
https://gcc.gnu.org/g:0c4df2c3c38ca15c123e9a801b617e63256c83a3 commit r14-9423-g0c4df2c3c38ca15c123e9a801b617e63256c83a3 Author: Eric Botcazou Date: Mon Mar 11 09:24:50 2024 +0100 Fix placement of recently implemented DIE It's the DIE added for enumeration types with reverse scalar storage order. gcc/ PR debug/113519 PR debug/113777 * dwarf2out.cc (gen_enumeration_type_die): In the reverse case, generate the DIE with the same parent as in the regular case. gcc/testsuite/ * gcc.dg/sso-20.c: New test. * gcc.dg/sso-21.c: Likewise. Diff: --- gcc/dwarf2out.cc | 7 --- gcc/testsuite/gcc.dg/sso-20.c | 19 +++ gcc/testsuite/gcc.dg/sso-21.c | 19 +++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 87e4240b871..8f18bc4fe64 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -22868,18 +22868,19 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die, bool reverse) if (type_die == NULL || reverse) { + dw_die_ref scope_die = scope_die_for (type, context_die); + /* The DIE with DW_AT_endianity is placed right after the naked DIE. */ if (reverse) { gcc_assert (type_die); dw_die_ref after_die = type_die; type_die = new_die_raw (DW_TAG_enumeration_type); - add_child_die_after (context_die, type_die, after_die); + add_child_die_after (scope_die, type_die, after_die); } else { - type_die = new_die (DW_TAG_enumeration_type, - scope_die_for (type, context_die), type); + type_die = new_die (DW_TAG_enumeration_type, scope_die, type); equate_type_number_to_die (type, type_die); } add_name_attribute (type_die, type_tag (type)); diff --git a/gcc/testsuite/gcc.dg/sso-20.c b/gcc/testsuite/gcc.dg/sso-20.c new file mode 100644 index 000..3bea38423a8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/sso-20.c @@ -0,0 +1,19 @@ +/* PR debug/113519 */ +/* Reported by Zdenek Sojka */ + +/* { dg-do compile } */ +/* { dg-options "-g -fdebug-types-section" } */ + +enum E { X }; + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +struct __attribute__((scalar_storage_order("big-endian"))) +{ + enum E e; +} S; +#else +struct __attribute__((scalar_storage_order("little-endian"))) +{ + enum E e; +} S; +#endif diff --git a/gcc/testsuite/gcc.dg/sso-21.c b/gcc/testsuite/gcc.dg/sso-21.c new file mode 100644 index 000..4b5d76d479b --- /dev/null +++ b/gcc/testsuite/gcc.dg/sso-21.c @@ -0,0 +1,19 @@ +/* PR debug/113777 */ +/* Reported by Zdenek Sojka */ + +/* { dg-do compile } */ +/* { dg-options "-g" } */ + +typedef short __attribute__((__hardbool__)) hbool; + +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +struct __attribute__((scalar_storage_order("big-endian"))) +{ + hbool a[2]; +} S; +#else +struct __attribute__((scalar_storage_order("little-endian"))) +{ + hbool a[2]; +} S; +#endif
[gcc r14-9424] bitint: Avoid rewriting large/huge _BitInt vars into SSA after bitint lowering [PR114278]
https://gcc.gnu.org/g:dbe5ccda4dbbd064c703cd3ab2a58ea40f08dd1a commit r14-9424-gdbe5ccda4dbbd064c703cd3ab2a58ea40f08dd1a Author: Jakub Jelinek Date: Mon Mar 11 11:00:54 2024 +0100 bitint: Avoid rewriting large/huge _BitInt vars into SSA after bitint lowering [PR114278] The following testcase ICEs, because update-address-taken subpass of fre5 rewrites _BitInt(128) b; vector(16) unsigned char _3; [local count: 1073741824]: _3 = MEM [(char * {ref-all})p_2(D)]; MEM [(char * {ref-all})&b] = _3; b ={v} {CLOBBER(eos)}; to _BitInt(128) b; vector(16) unsigned char _3; [local count: 1073741824]: _3 = MEM [(char * {ref-all})p_2(D)]; b_5 = VIEW_CONVERT_EXPR<_BitInt(128)>(_3); but we can't have large/huge _BitInt vars in SSA form after the bitint lowering except for function arguments loaded from memory, as expansion isn't able to deal with those, it relies on bitint lowering to lower those operations. The following patch fixes that by setting DECL_NOT_GIMPLE_REG_P for large/huge _BitInt vars after bitint lowering, such that we don't rewrite them into SSA form. 2024-03-11 Jakub Jelinek PR tree-optimization/114278 * tree-ssa.cc (maybe_optimize_var): If large/huge _BitInt vars are no longer addressable, set DECL_NOT_GIMPLE_REG_P on them. * gcc.dg/bitint-99.c: New test. Diff: --- gcc/testsuite/gcc.dg/bitint-99.c | 26 ++ gcc/tree-ssa.cc | 14 ++ 2 files changed, 40 insertions(+) diff --git a/gcc/testsuite/gcc.dg/bitint-99.c b/gcc/testsuite/gcc.dg/bitint-99.c new file mode 100644 index 000..a0aa446087d --- /dev/null +++ b/gcc/testsuite/gcc.dg/bitint-99.c @@ -0,0 +1,26 @@ +/* PR tree-optimization/114278 */ +/* { dg-do compile { target bitint } } */ +/* { dg-options "-O2 -fno-tree-dce -fno-tree-dse -fno-tree-ccp" } */ +/* { dg-additional-options "-mavx2" { target i?86-*-* x86_64-*-* } } */ + +void +foo (void *p) +{ + _BitInt(64) b = *(_BitInt(64) *) __builtin_memmove (&b, p, sizeof (_BitInt(64))); +} + +#if __BITINT_MAXWIDTH__ >= 128 +void +bar (void *p) +{ + _BitInt(128) b = *(_BitInt(128) *) __builtin_memmove (&b, p, sizeof (_BitInt(128))); +} +#endif + +#if __BITINT_MAXWIDTH__ >= 256 +void +baz (void *p) +{ + _BitInt(256) b = *(_BitInt(256) *) __builtin_memmove (&b, p, sizeof (_BitInt(256))); +} +#endif diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc index 16f42a6022a..27ab9cfac82 100644 --- a/gcc/tree-ssa.cc +++ b/gcc/tree-ssa.cc @@ -1785,6 +1785,20 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs, fprintf (dump_file, "\n"); } } + else if (TREE_CODE (TREE_TYPE (var)) == BITINT_TYPE + && (cfun->curr_properties & PROP_gimple_lbitint) != 0 + && TYPE_PRECISION (TREE_TYPE (var)) > MAX_FIXED_MODE_SIZE) + { + /* Don't rewrite large/huge _BitInt vars after _BitInt lowering +into SSA form. */ + DECL_NOT_GIMPLE_REG_P (var) = 1; + if (dump_file) + { + fprintf (dump_file, "_BitInt var after its lowering: "); + print_generic_expr (dump_file, var); + fprintf (dump_file, "\n"); + } + } else if (DECL_NOT_GIMPLE_REG_P (var)) { maybe_reg = true;
[gcc r14-9425] middle-end/114299 - missing error recovery from gimplify failure
https://gcc.gnu.org/g:119f5ae0455f02568159eafa9008a555605e7d71 commit r14-9425-g119f5ae0455f02568159eafa9008a555605e7d71 Author: Richard Biener Date: Mon Mar 11 09:35:07 2024 +0100 middle-end/114299 - missing error recovery from gimplify failure When internal_get_tmp_var fails to gimplify the value the temporary SSA name is supposed to be initialized with we can leak SSA names with a NULL SSA_NAME_DEF_STMT into the IL. That's bad, so recover from this by instead returning a decl in that case. PR middle-end/114299 * gimplify.cc (internal_get_tmp_var): When gimplification of VAL failed, return a decl. * gcc.target/i386/pr114299.c: New testcase. Diff: --- gcc/gimplify.cc | 5 + gcc/testsuite/gcc.target/i386/pr114299.c | 14 ++ 2 files changed, 19 insertions(+) diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 6ebca964cb2..d64bbf3ffbd 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -652,6 +652,11 @@ internal_get_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p, gimplify_and_add (mod, pre_p); ggc_free (mod); + /* If we failed to gimplify VAL then we can end up with the temporary + SSA name not having a definition. In this case return a decl. */ + if (TREE_CODE (t) == SSA_NAME && ! SSA_NAME_DEF_STMT (t)) +return lookup_tmp_var (val, is_formal, not_gimple_reg); + return t; } diff --git a/gcc/testsuite/gcc.target/i386/pr114299.c b/gcc/testsuite/gcc.target/i386/pr114299.c new file mode 100644 index 000..b4f30b7a95f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr114299.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target lp64 } } */ +/* { dg-options "-mgeneral-regs-only" } */ + +typedef __attribute__((__vector_size__(8))) __bf16 V; +typedef __attribute__((__vector_size__(16))) __bf16 W; + +V v; +_Atomic V a; + +W +foo(void) /* { dg-error "SSE" } */ +{ + return __builtin_shufflevector(v, a, 1, 2, 5, 0, 1, 6, 6, 4); /* { dg-error "invalid" } */ +}
[gcc r14-9426] aarch64,arm: Move branch-protection data to targets
https://gcc.gnu.org/g:1bf70e68e4910fe0904466d06cae7f747c02ab72 commit r14-9426-g1bf70e68e4910fe0904466d06cae7f747c02ab72 Author: Szabolcs Nagy Date: Mon Jun 19 12:56:41 2023 +0100 aarch64,arm: Move branch-protection data to targets The branch-protection types are target specific, not the same on arm and aarch64. This currently affects pac-ret+b-key, but there will be a new type on aarch64 that is not relevant for arm. After the move, change aarch_ identifiers to aarch64_ or arm_ as appropriate. Refactor aarch_validate_mbranch_protection to take the target specific branch-protection types as an argument. In case of invalid input currently no hints are provided: the way branch-protection types and subtypes can be mixed makes it difficult without causing confusion. gcc/ChangeLog: * config/aarch64/aarch64.md: Rename aarch_ to aarch64_. * config/aarch64/aarch64.opt: Likewise. * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Likewise. * config/aarch64/aarch64.cc (aarch64_expand_prologue): Likewise. (aarch64_expand_epilogue): Likewise. (aarch64_post_cfi_startproc): Likewise. (aarch64_handle_no_branch_protection): Copy and rename. (aarch64_handle_standard_branch_protection): Likewise. (aarch64_handle_pac_ret_protection): Likewise. (aarch64_handle_pac_ret_leaf): Likewise. (aarch64_handle_pac_ret_b_key): Likewise. (aarch64_handle_bti_protection): Likewise. (aarch64_override_options): Update branch protection validation. (aarch64_handle_attr_branch_protection): Likewise. * config/arm/aarch-common-protos.h (aarch_validate_mbranch_protection): Pass branch protection type description as argument. (struct aarch_branch_protect_type): Move from aarch-common.h. * config/arm/aarch-common.cc (aarch_handle_no_branch_protection): Remove. (aarch_handle_standard_branch_protection): Remove. (aarch_handle_pac_ret_protection): Remove. (aarch_handle_pac_ret_leaf): Remove. (aarch_handle_pac_ret_b_key): Remove. (aarch_handle_bti_protection): Remove. (aarch_validate_mbranch_protection): Pass branch protection type description as argument. * config/arm/aarch-common.h (enum aarch_key_type): Remove. (struct aarch_branch_protect_type): Remove. * config/arm/arm-c.cc (arm_cpu_builtins): Remove aarch_ra_sign_key. * config/arm/arm.cc (arm_handle_no_branch_protection): Copy and rename. (arm_handle_standard_branch_protection): Likewise. (arm_handle_pac_ret_protection): Likewise. (arm_handle_pac_ret_leaf): Likewise. (arm_handle_bti_protection): Likewise. (arm_configure_build_target): Update branch protection validation. * config/arm/arm.opt: Remove aarch_ra_sign_key. Diff: --- gcc/config/aarch64/aarch64-c.cc | 4 +- gcc/config/aarch64/aarch64.cc| 75 +++- gcc/config/aarch64/aarch64.md| 2 +- gcc/config/aarch64/aarch64.opt | 2 +- gcc/config/arm/aarch-common-protos.h | 19 - gcc/config/arm/aarch-common.cc | 71 +- gcc/config/arm/aarch-common.h| 20 -- gcc/config/arm/arm-c.cc | 2 - gcc/config/arm/arm.cc| 55 ++ gcc/config/arm/arm.opt | 3 -- 10 files changed, 145 insertions(+), 108 deletions(-) diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index c3bc8c49034..b5a6917d06d 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -235,9 +235,9 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) if (aarch_ra_sign_scope != AARCH_FUNCTION_NONE) { int v = 0; - if (aarch_ra_sign_key == AARCH_KEY_A) + if (aarch64_ra_sign_key == AARCH64_KEY_A) v |= 1; - if (aarch_ra_sign_key == AARCH_KEY_B) + if (aarch64_ra_sign_key == AARCH64_KEY_B) v |= 2; if (aarch_ra_sign_scope == AARCH_FUNCTION_ALL) v |= 4; diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 0a28e033088..ae040781c43 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -9541,12 +9541,12 @@ aarch64_expand_prologue (void) /* Sign return address for functions. */ if (aarch64_return_address_signing_enabled ()) { - switch (aarch_ra_sign_key) + switch (aarch64_ra_sign_key) { - case AARCH_KEY_A: + case AARCH64_KEY_A: insn = emit_insn (gen_paciasp ()); break; - case AARCH_KEY_B: + case AARCH64_KEY_B: insn = emit_insn (gen_
[gcc r14-9427] testsuite: vect: Require vect_perm in several tests [PR114071, PR113557, PR96109]
https://gcc.gnu.org/g:96b63fa255e343bb9b3e7f77302213a91ce96293 commit r14-9427-g96b63fa255e343bb9b3e7f77302213a91ce96293 Author: Rainer Orth Date: Mon Mar 11 15:45:17 2024 +0100 testsuite: vect: Require vect_perm in several tests [PR114071, PR113557, PR96109] Several vectorization tests FAIL on 32 and 64-bit Solaris/SPARC: FAIL: gcc.dg/vect/pr37027.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/pr37027.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/pr37027.c scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/pr37027.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/pr67790.c -flto -ffat-lto-objects scan-tree-dump vect "vectorizing stmts using SLP" FAIL: gcc.dg/vect/pr67790.c scan-tree-dump vect "vectorizing stmts using SLP" FAIL: gcc.dg/vect/slp-47.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 2 FAIL: gcc.dg/vect/slp-47.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 FAIL: gcc.dg/vect/slp-48.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 2 FAIL: gcc.dg/vect/slp-48.c scan-tree-dump-times vect "vectorizing stmts using SLP" 2 FAIL: gcc.dg/vect/slp-reduc-1.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-1.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-1.c scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-1.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-2.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-2.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-2.c scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-2.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-7.c scan-tree-dump-times vect "vectorized 1 loops" 1 FAIL: gcc.dg/vect/slp-reduc-7.c scan-tree-dump-times vect "vectorizing stmts using SLP" 1 FAIL: gcc.dg/vect/slp-reduc-8.c -flto -ffat-lto-objects scan-tree-dump vect "vectorized 1 loops" FAIL: gcc.dg/vect/slp-reduc-8.c scan-tree-dump vect "vectorized 1 loops" FAIL: gcc.dg/vect/vect-multi-peel-gaps.c -flto -ffat-lto-objects scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-multi-peel-gaps.c scan-tree-dump vect "LOOP VECTORIZED" The dumps show variations of /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: note: ==> examining statement: _4 = a[i_19].f2; /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: missed: unsupported vect permute { 1 0 3 2 5 4 } /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: missed: unsupported load permutation /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:27:17: missed: not vectorized: relevant stmt not supported: _4 = a[i_19].f2; so I think the tests should require vect_perm. This is what this patch does Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2024-02-22 Rainer Orth gcc/testsuite: PR tree-optimization/114071 * gcc.dg/vect/pr37027.c: Require vect_perm. * gcc.dg/vect/pr67790.c: Likewise. * gcc.dg/vect/slp-reduc-1.c: Likewise. * gcc.dg/vect/slp-reduc-2.c: Likewise. * gcc.dg/vect/slp-reduc-7.c: Likewise. * gcc.dg/vect/slp-reduc-8.c: Likewise. PR tree-optimization/113557 * gcc.dg/vect/vect-multi-peel-gaps.c (scan-tree-dump): Also require vect_perm. PR testsuite/96109 * gcc.dg/vect/slp-47.c: Require vect_perm. * gcc.dg/vect/slp-48.c: Likewise. Diff: --- gcc/testsuite/gcc.dg/vect/pr37027.c | 1 + gcc/testsuite/gcc.dg/vect/pr67790.c | 1 + gcc/testsuite/gcc.dg/vect/slp-47.c | 1 + gcc/testsuite/gcc.dg/vect/slp-48.c | 1 + gcc/testsuite/gcc.dg/vect/slp-reduc-1.c | 1 + gcc/testsuite/gcc.dg/vect/slp-reduc-2.c | 1 + gcc/testsuite/gcc.dg/vect/slp-reduc-7.c | 1 + gcc/testsuite/gcc.dg/vect/slp-reduc-8.c | 1 + gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c | 2 +- 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/
[gcc r14-9428] testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/vect-cost-model-1.c etc. [PR98238]
https://gcc.gnu.org/g:4e1fcf44bdc582e71408175d75e025f5be8b0e55 commit r14-9428-g4e1fcf44bdc582e71408175d75e025f5be8b0e55 Author: Rainer Orth Date: Mon Mar 11 15:46:30 2024 +0100 testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/vect-cost-model-1.c etc. [PR98238] Several gcc.dg/vect/vect-cost-model-?.c tests FAIL on 32 and 64-bit Solaris/SPARC: FAIL: gcc.dg/vect/vect-cost-model-1.c -flto -ffat-lto-objects scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-cost-model-1.c scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-cost-model-3.c -flto -ffat-lto-objects scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-cost-model-3.c scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-cost-model-5.c -flto -ffat-lto-objects scan-tree-dump vect "LOOP VECTORIZED" FAIL: gcc.dg/vect/vect-cost-model-5.c scan-tree-dump vect "LOOP VECTORIZED" The dumps show /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:7:30: note: ==> examining statement: _3 = *_2; /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:7:30: missed: unsupported unaligned access /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:8:6: missed: not vectorized: relevant stmt not supported: _3 = *_2; so I think the tests need to require vect_hw_misalign. This is what this patch does. Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2024-02-22 Rainer Orth gcc/testsuite: PR tree-optimization/98238 * gcc.dg/vect/vect-cost-model-1.c (scan-tree-dump): Also require vect_hw_misalign. * gcc.dg/vect/vect-cost-model-3.c: Likewise. * gcc.dg/vect/vect-cost-model-5.c: Likewise. Diff: --- gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c index 0737da5d671..1457e8f3625 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c @@ -8,4 +8,4 @@ f (int *x, int *y) x[i] += y[i]; } -/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */ +/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c index d7c6cfd2049..fba18aae0cf 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c @@ -8,4 +8,4 @@ f (int *restrict x, int *restrict y) x[i] += y[i]; } -/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */ +/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c index 536ec0a3cda..b9d0ca47af2 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c @@ -8,4 +8,4 @@ f (int *restrict x, int *restrict y) x[i] += y[i]; } -/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */ +/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */
[gcc r14-9429] PR modula2/114295 Incorrect location if compiling implementation without definition
https://gcc.gnu.org/g:8410402272038aae7e4b2bd76df38607a78cad95 commit r14-9429-g8410402272038aae7e4b2bd76df38607a78cad95 Author: Gaius Mulley Date: Mon Mar 11 15:21:42 2024 + PR modula2/114295 Incorrect location if compiling implementation without definition This patch fixes a bug which occurred if gm2 was asked to compile an implementation module and could not find the definition module. The error location would be set to the SYSTEM module. The bug occurred as the module sym was created during the peep phase after which the few tokens are destroyed and recreated during parsing. The bug fix is to call PutDeclared when the module is encountered during parsing which updates the tokenno associated with the module. gcc/m2/ChangeLog: PR modula2/114295 * gm2-compiler/M2Batch.mod (MakeProgramSource): Call PutDeclared if the module is known. (MakeDefinitionSource): Ditto. (MakeImplementationSource): Ditto. * gm2-compiler/M2Comp.mod (ExamineHeader): New procedure. (ExamineCompilationUnit): Rewrite. (PeepInto): Rewrite. * gm2-compiler/M2Error.mod (NewError): Remove default call to GetTokenNo. * gm2-compiler/M2Quads.mod (callRequestDependant): Push tokno with Adr. (BuildStringAdrParam): Ditto. (doBuildBinaryOp): Push OperatorPos on the bool stack. (BuildRelOp): Ditto. * gm2-compiler/P2Build.bnf (SetType): Pass set token pos to BuildSetType. (PointerType): Pass pointer token pos to BuildPointerType. * gm2-compiler/P2SymBuild.def (BuildPointerType): Add parameter pointerpos. (BuildSetType): Add parameter setpos. * gm2-compiler/P2SymBuild.mod (BuildPointerType): Add parameter pointerpos. Build combined token and use it when creating a pointer type. (BuildSetType): Add parameter setpos. Build combined token and use it when creating a set type. * gm2-compiler/SymbolTable.mod (DebugUnknownToken): New constant. (CheckTok): New procedure function. (MakeProcedure): Call CheckTok. (MakeRecord): Ditto. (MakeVarient): Ditto. (MakeEnumeration): Ditto. (MakeHiddenType): Ditto. (MakeConstant): Ditto. (MakeConstStringCnul): Ditto. (MakeSubrange): Ditto. (MakeTemporary): Ditto. (MakeVariableForParam): Ditto. (MakeParameterHeapVar): Ditto. (MakePointer): Ditto. (MakeSet): Ditto. (MakeUnbounded): Ditto. (MakeProcType): Ditto. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Batch.mod | 12 - gcc/m2/gm2-compiler/M2Comp.mod | 88 +++-- gcc/m2/gm2-compiler/M2Error.mod | 6 +-- gcc/m2/gm2-compiler/M2Quads.mod | 42 +- gcc/m2/gm2-compiler/P2Build.bnf | 13 +++--- gcc/m2/gm2-compiler/P2SymBuild.def | 4 +- gcc/m2/gm2-compiler/P2SymBuild.mod | 45 ++- gcc/m2/gm2-compiler/SymbolTable.mod | 47 +++- 8 files changed, 179 insertions(+), 78 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Batch.mod b/gcc/m2/gm2-compiler/M2Batch.mod index d6eb53ff90d..8cfc906513c 100644 --- a/gcc/m2/gm2-compiler/M2Batch.mod +++ b/gcc/m2/gm2-compiler/M2Batch.mod @@ -23,7 +23,11 @@ IMPLEMENTATION MODULE M2Batch ; FROM M2Debug IMPORT Assert ; -FROM SymbolTable IMPORT MakeModule, MakeDefImp, IsModule, IsDefImp, GetScope, GetLocalSym, GetCurrentScope, GetSym, NulSym ; + +FROM SymbolTable IMPORT MakeModule, MakeDefImp, IsModule, IsDefImp, +GetScope, GetLocalSym, GetCurrentScope, +PutDeclared, GetSym, NulSym ; + FROM NameKey IMPORT GetKey, WriteKey ; FROM M2Printf IMPORT printf2 ; FROM M2Error IMPORT InternalError ; @@ -69,6 +73,8 @@ BEGIN Sym := MakeModule (tok, n) ; Put (Sym, n) ; Push (Sym) + ELSE + PutDeclared (tok, Sym) END ; RETURN Sym END MakeProgramSource ; @@ -96,6 +102,8 @@ BEGIN Sym := MakeDefImp (tok, n) ; Put (Sym, n) ; Push (Sym) + ELSE + PutDeclared (tok, Sym) END ; RETURN Sym END MakeDefinitionSource ; @@ -123,6 +131,8 @@ BEGIN Sym := MakeDefImp (tok, n) ; Put (Sym, n) ; Push (Sym) + ELSE + PutDeclared (tok, Sym) END ; RETURN Sym END MakeImplementationSource ; diff --git a/gcc/m2/gm2-compiler/M2Comp.mod b/gcc/m2/gm2-compiler/M2Comp.mod index c10c301cbde..719ae6641dc 100644 --- a/gcc/m2/gm2-compiler/M2Comp.mod +++ b/gcc/m2/gm2-compiler/M2Comp.mod @@ -30,7 +30,8 @@ FROM M2Search IMPORT FindSourceDefFile, FindSourceModFile ; FROM M2Code IMPORT Code ; FROM M2LexBuf IMPORT OpenSource, CloseSo
[gcc r14-9430] gomp: testsuite: improve compatibility of bad-array-section-3.c [PR113428]
https://gcc.gnu.org/g:c27b30552e6cc789425d3628d294dafc5f3a0861 commit r14-9430-gc27b30552e6cc789425d3628d294dafc5f3a0861 Author: Richard Earnshaw Date: Wed Mar 6 13:41:02 2024 + gomp: testsuite: improve compatibility of bad-array-section-3.c [PR113428] This test generates different warnings on ilp32 targets because the size of an integer matches the size of a pointer. Avoid this by using signed char. gcc/testsuite: PR testsuite/113428 * gcc.dg/gomp/bad-array-section-c-3.c: Use signed char instead of int. Diff: --- gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c index 8be15ced8c0..431af71c422 100644 --- a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c +++ b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c @@ -1,15 +1,15 @@ /* { dg-do compile } */ struct S { - int *ptr; + signed char *ptr; }; int main() { - int arr[20]; + signed char arr[20]; /* Reject array section in compound initialiser. */ -#pragma omp target map( (struct S) { .ptr = (int *) arr[5:5] } ) +#pragma omp target map( (struct S) { .ptr = (signed char *) arr[5:5] } ) /* { dg-error {expected '\]' before ':' token} "" { target *-*-* } .-1 } */ /* { dg-warning {cast to pointer from integer of different size} "" { target *-*-* } .-2 } */ /* { dg-message {sorry, unimplemented: unsupported map expression} "" { target *-*-* } .-3 } */
[gcc r14-9431] Update gcc sv.po
https://gcc.gnu.org/g:9b3243858bed000b0ee8c3cf718f61b0e75e72ec commit r14-9431-g9b3243858bed000b0ee8c3cf718f61b0e75e72ec Author: Joseph Myers Date: Mon Mar 11 19:36:52 2024 + Update gcc sv.po * sv.po: Update. Diff: --- gcc/po/sv.po | 437 --- 1 file changed, 177 insertions(+), 260 deletions(-) diff --git a/gcc/po/sv.po b/gcc/po/sv.po index f24eb1bbd34..536fe50f1c0 100644 --- a/gcc/po/sv.po +++ b/gcc/po/sv.po @@ -32,7 +32,7 @@ msgstr "" "Project-Id-Version: gcc 14.1-b20240218\n" "Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"; "POT-Creation-Date: 2024-02-16 21:35+\n" -"PO-Revision-Date: 2024-03-03 17:38+0100\n" +"PO-Revision-Date: 2024-03-10 13:32+0100\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" "Language: sv\n" @@ -1635,10 +1635,9 @@ msgid "Warn about C++26 constructs in code compiled with an older standard." msgstr "Varna för C++26-konstruktioner i kod kompilerad med en äldre standard." #: c-family/c.opt:507 -#, fuzzy, no-c-format -#| msgid "Warn about suspicious divisions of two sizeof expressions that don't work correctly with pointers." +#, no-c-format msgid "Warn about suspicious calls to calloc-like functions where sizeof expression is the earlier size argument and not the latter." -msgstr "Varna för misstänkta divisioner av två sizeof-uttryck som inte fungerar korrekt med pekare." +msgstr "Varna för misstänkta anrop av calloc-liknande funktioner där sizeof-uttryck är det tidigare storleksargumentet och inte det senare." #: c-family/c.opt:511 #, no-c-format @@ -1758,10 +1757,9 @@ msgid "Warn when a declaration is found after a statement." msgstr "Varna när en deklaration hittas efter en sats." #: c-family/c.opt:612 -#, fuzzy, no-c-format -#| msgid "Warn about unprototyped function declarations." +#, no-c-format msgid "Warn for missing parameter types in function declarations." -msgstr "Varna för funktionsdeklarationer utan prototyp." +msgstr "Varna för saknade parametertyper i funktionsdeklarationer." #: c-family/c.opt:616 #, no-c-format @@ -2174,10 +2172,9 @@ msgid "Warn when the template keyword is missing after a member access token in msgstr "Varna när nyckelordet template saknas efter en medlemsåtkomstsymbol i en beroende medlems åtkomstuttryck om den medlemmen är en mall." #: c-family/c.opt:994 -#, fuzzy, no-c-format -#| msgid "Warn about global functions without previous declarations." +#, no-c-format msgid "Warn about global variables without previous declarations." -msgstr "Varna för globala funktioner utan tidigare deklaration." +msgstr "Varna för globala variabler utan tidigare deklaration." #: c-family/c.opt:1001 #, no-c-format @@ -2265,10 +2262,9 @@ msgid "Warn about potentially suboptimal choices related to OpenACC parallelism. msgstr "Varna för potentiellt suboptimala val relaterade till OpenACC-parallellism." #: c-family/c.opt:1101 -#, fuzzy, no-c-format -#| msgid "Warn about \"suspicious\" constructs." +#, no-c-format msgid "Warn about suspicious OpenMP code." -msgstr "Varna för ”misstänkta” konstruktioner." +msgstr "Varna för misstänkt OpenMP-kod." #: c-family/c.opt:1105 #, no-c-format @@ -2606,10 +2602,9 @@ msgid "Warn if a comparison always evaluates to true or false." msgstr "Varna om en logisk jämförelse alltid beräknas till sant eller falskt." #: c-family/c.opt:1413 -#, fuzzy, no-c-format -#| msgid "template-id not allowed for destructor" +#, no-c-format msgid "Warn about simple-template-id in a constructor or destructor." -msgstr "mall-id är inte tillåtet för destruerare" +msgstr "Varna för simple-template-id i en konstruerare eller destruerare." #: c-family/c.opt:1417 #, no-c-format @@ -2918,10 +2913,9 @@ msgid "Print hierarchical comparisons when template types are mismatched." msgstr "Skriv ut hierarkiska jämförelser när malltyper inte stämmer överens." #: c-family/c.opt:1818 -#, fuzzy, no-c-format -#| msgid "default argument mismatch in overload resolution" +#, no-c-format msgid "Note all candidates during overload resolution failure." -msgstr "standardargument stämmer inte överens i upplösning av överlagring" +msgstr "Notera alla kandidater under misslyckad upplösning av överlagring." #: c-family/c.opt:1822 #, no-c-format @@ -3084,10 +3078,9 @@ msgid "Warn about macros that have conflicting header units definitions." msgstr "Varna för makron som har motstridiga huvudenhetsdefinitioner." #: c-family/c.opt:1992 -#, fuzzy, no-c-format -#| msgid "Warn when a pointer is compared with a zero character constant." +#, no-c-format msgid "Warn if pointers of distinct types are compared without a cast." -msgstr "Varna när en pekare jämförs med en noll-teckenkonstant." +msgstr "Varna om pekare av distinkta typer jämförs utan en typkonvertering." #: c-family/c.opt:1996 #, no-c-format @@ -3130,10 +3123,9 @@ msgid "Implement resolution of DR 150 for matching of template template argumen
[gcc r14-9432] libgfortran: [PR114304] Revert portion of PR105347 change.
https://gcc.gnu.org/g:0c179654c3170749f3fb3232f2442fcbc99bffbb commit r14-9432-g0c179654c3170749f3fb3232f2442fcbc99bffbb Author: Jerry DeLisle Date: Mon Mar 11 15:15:34 2024 -0700 libgfortran: [PR114304] Revert portion of PR105347 change. PR libfortran/105437 PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Remove check for decimal point mode and semicolon used as a seprator. Removes the regression. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Add additional checks to address the case of semicolon at the end of a line. Diff: --- gcc/testsuite/gfortran.dg/pr105473.f90 | 21 ++--- libgfortran/io/list_read.c | 12 +--- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/pr105473.f90 b/gcc/testsuite/gfortran.dg/pr105473.f90 index b309217540d..2679f6bb447 100644 --- a/gcc/testsuite/gfortran.dg/pr105473.f90 +++ b/gcc/testsuite/gfortran.dg/pr105473.f90 @@ -3,44 +3,51 @@ implicit none integer n,m,ios real r + real :: x(3) complex z character(40):: testinput n = 999; m = 777; r=1.2345 z = cmplx(0.0,0.0) -! Check that semi-colon is not allowed as separator with decimal=point. +! Check that semi-colon is allowed as separator with decimal=point. ios=0 testinput = '1;17;3.14159' read(testinput,*,decimal='point',iostat=ios) n, m, r - if (ios /= 5010) print *, "stop 1" + if (ios /= 0) stop 1 +! Check that semi-colon allowed as a separator with decimal=point. + ios=0 + testinput = '1.23435 1243.24 13.24 ;' + read(testinput, *, iostat=ios) x + if (ios /= 0) stop 2 + ! Check that comma is not allowed as a separator with decimal=comma. ios=0 testinput = '1,17,3,14159' read(testinput,*,decimal='comma',iostat=ios) n, m, r - if (ios /= 5010) print *, "stop 2" + if (ios /= 5010) stop 3 ! Check a good read. ios=99 testinput = '1;17;3,14159' read(testinput,*,decimal='comma',iostat=ios) n, m, r - if (ios /= 0) print *, "stop 3" + if (ios /= 0) stop 4 ! Check that comma is not allowed as a separator with decimal=comma. ios=99; z = cmplx(0.0,0.0) testinput = '1,17, (3,14159, 1,7182)' read(testinput,*,decimal='comma', iostat=ios) n, m, z - if (ios /= 5010) stop 4 + if (ios /= 5010) stop 5 ! Check that semi-colon is not allowed as separator with decimal=point. ios=99; z = cmplx(0.0,0.0) testinput = '1,17; (3.14159; 1.7182)' read(testinput,*,decimal='point', iostat=ios) n, m, z - if (ios /= 5010) stop 5 + if (ios /= 5010) stop 6 ! Check a good read. ios=99;z = cmplx(0.0,0.0) testinput = '1;17; (3,14159; 1,7182)' read(testinput,*,decimal='comma', iostat=ios) n, m, z - if (ios /= 0) stop 6 + if (ios /= 0) stop 7 end program diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index e38e9a84976..fb3f7dbc34d 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -476,18 +476,8 @@ eat_separator (st_parameter_dt *dtp) unget_char (dtp, c); break; } - dtp->u.p.comma_flag = 1; - eat_spaces (dtp); - break; - +/* Fall through. */ case ';': - if (dtp->u.p.current_unit->decimal_status == DECIMAL_POINT) - { - generate_error (&dtp->common, LIBERROR_READ_VALUE, - "Semicolon not allowed as separator with DECIMAL='point'"); - unget_char (dtp, c); - break; - } dtp->u.p.comma_flag = 1; eat_spaces (dtp); break;
[gcc r13-8417] libgfortran: [PR114304] Revert portion of PR105347 change.
https://gcc.gnu.org/g:824a71f609b37a8121793075b175e2bbe14fdb82 commit r13-8417-g824a71f609b37a8121793075b175e2bbe14fdb82 Author: Jerry DeLisle Date: Mon Mar 11 15:15:34 2024 -0700 libgfortran: [PR114304] Revert portion of PR105347 change. PR libfortran/105437 PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Remove check for decimal point mode and semicolon used as a seprator. Removes the regression. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Add additional checks to address the case of semicolon at the end of a line. (cherry picked from commit 0c179654c3170749f3fb3232f2442fcbc99bffbb) Diff: --- gcc/testsuite/gfortran.dg/pr105473.f90 | 21 ++--- libgfortran/io/list_read.c | 12 +--- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/pr105473.f90 b/gcc/testsuite/gfortran.dg/pr105473.f90 index b309217540d..2679f6bb447 100644 --- a/gcc/testsuite/gfortran.dg/pr105473.f90 +++ b/gcc/testsuite/gfortran.dg/pr105473.f90 @@ -3,44 +3,51 @@ implicit none integer n,m,ios real r + real :: x(3) complex z character(40):: testinput n = 999; m = 777; r=1.2345 z = cmplx(0.0,0.0) -! Check that semi-colon is not allowed as separator with decimal=point. +! Check that semi-colon is allowed as separator with decimal=point. ios=0 testinput = '1;17;3.14159' read(testinput,*,decimal='point',iostat=ios) n, m, r - if (ios /= 5010) print *, "stop 1" + if (ios /= 0) stop 1 +! Check that semi-colon allowed as a separator with decimal=point. + ios=0 + testinput = '1.23435 1243.24 13.24 ;' + read(testinput, *, iostat=ios) x + if (ios /= 0) stop 2 + ! Check that comma is not allowed as a separator with decimal=comma. ios=0 testinput = '1,17,3,14159' read(testinput,*,decimal='comma',iostat=ios) n, m, r - if (ios /= 5010) print *, "stop 2" + if (ios /= 5010) stop 3 ! Check a good read. ios=99 testinput = '1;17;3,14159' read(testinput,*,decimal='comma',iostat=ios) n, m, r - if (ios /= 0) print *, "stop 3" + if (ios /= 0) stop 4 ! Check that comma is not allowed as a separator with decimal=comma. ios=99; z = cmplx(0.0,0.0) testinput = '1,17, (3,14159, 1,7182)' read(testinput,*,decimal='comma', iostat=ios) n, m, z - if (ios /= 5010) stop 4 + if (ios /= 5010) stop 5 ! Check that semi-colon is not allowed as separator with decimal=point. ios=99; z = cmplx(0.0,0.0) testinput = '1,17; (3.14159; 1.7182)' read(testinput,*,decimal='point', iostat=ios) n, m, z - if (ios /= 5010) stop 5 + if (ios /= 5010) stop 6 ! Check a good read. ios=99;z = cmplx(0.0,0.0) testinput = '1;17; (3,14159; 1,7182)' read(testinput,*,decimal='comma', iostat=ios) n, m, z - if (ios /= 0) stop 6 + if (ios /= 0) stop 7 end program diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 6ae8de548bb..eabc67c16af 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -480,18 +480,8 @@ eat_separator (st_parameter_dt *dtp) unget_char (dtp, c); break; } - dtp->u.p.comma_flag = 1; - eat_spaces (dtp); - break; - +/* Fall through. */ case ';': - if (dtp->u.p.current_unit->decimal_status == DECIMAL_POINT) - { - generate_error (&dtp->common, LIBERROR_READ_VALUE, - "Semicolon not allowed as separator with DECIMAL='point'"); - unget_char (dtp, c); - break; - } dtp->u.p.comma_flag = 1; eat_spaces (dtp); break;
[gcc r14-9434] Reject -fno-multiflags [PR114314]
https://gcc.gnu.org/g:c4e5789cede6974b6483c0f82069ff80b5a547e4 commit r14-9434-gc4e5789cede6974b6483c0f82069ff80b5a547e4 Author: Andrew Pinski Date: Mon Mar 11 17:40:08 2024 -0700 Reject -fno-multiflags [PR114314] When -fmultiflags option support was added in r13-3693-g6b1a2474f9e422, it accidently allowed -fno-multiflags which then would pass on to cc1. This fixes that oversight. Committed as obvious after bootstrap/test on x86_64-linux-gnu. gcc/ChangeLog: PR driver/114314 * common.opt (fmultiflags): Add RejectNegative. Signed-off-by: Andrew Pinski Diff: --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt index 51c4a17da83..1ad0169bd6f 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2295,7 +2295,7 @@ Common Var(flag_move_loop_stores) Optimization Move stores out of loops. fmultiflags -Common Driver +Common Driver RejectNegative Building block for specs-based multilib-aware TFLAGS. fdce
[gcc r13-8419] Reject -fno-multiflags [PR114314]
https://gcc.gnu.org/g:4bd9d097197334e786690ba1566ccf79396da730 commit r13-8419-g4bd9d097197334e786690ba1566ccf79396da730 Author: Andrew Pinski Date: Mon Mar 11 17:40:08 2024 -0700 Reject -fno-multiflags [PR114314] When -fmultiflags option support was added in r13-3693-g6b1a2474f9e422, it accidently allowed -fno-multiflags which then would pass on to cc1. This fixes that oversight. Committed as obvious after bootstrap/test on x86_64-linux-gnu. gcc/ChangeLog: PR driver/114314 * common.opt (fmultiflags): Add RejectNegative. Signed-off-by: Andrew Pinski (cherry picked from commit c4e5789cede6974b6483c0f82069ff80b5a547e4) Diff: --- gcc/common.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt index 862c474d3c8..b055c7bd9ac 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2182,7 +2182,7 @@ Common Var(flag_move_loop_stores) Optimization Move stores out of loops. fmultiflags -Common Driver +Common Driver RejectNegative Building block for specs-based multilib-aware TFLAGS. fdce
[gcc r13-8420] Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95351]
https://gcc.gnu.org/g:ac96973150b3279fe157f160efd83995077c7590 commit r13-8420-gac96973150b3279fe157f160efd83995077c7590 Author: Andrew Pinski Date: Sun Mar 10 22:17:09 2024 + Fold: Fix up merge_truthop_with_opposite_arm for NaNs [PR95351] The problem here is that merge_truthop_with_opposite_arm would use the type of the result of the comparison rather than the operands of the comparison to figure out if we are honoring NaNs. This fixes that oversight and now we get the correct results in this case. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR middle-end/95351 gcc/ChangeLog: * fold-const.cc (merge_truthop_with_opposite_arm): Use the type of the operands of the comparison and not the type of the comparison. gcc/testsuite/ChangeLog: * gcc.dg/float_opposite_arm-1.c: New test. Signed-off-by: Andrew Pinski (cherry picked from commit 31ce2e993d09dcad1ce139a2848a28de5931056d) Diff: --- gcc/fold-const.cc | 3 ++- gcc/testsuite/gcc.dg/float_opposite_arm-1.c | 17 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 7ebcac30666..a40b0d98ae7 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -6223,7 +6223,6 @@ static tree merge_truthop_with_opposite_arm (location_t loc, tree op, tree cmpop, bool rhs_only) { - tree type = TREE_TYPE (cmpop); enum tree_code code = TREE_CODE (cmpop); enum tree_code truthop_code = TREE_CODE (op); tree lhs = TREE_OPERAND (op, 0); @@ -6239,6 +6238,8 @@ merge_truthop_with_opposite_arm (location_t loc, tree op, tree cmpop, if (TREE_CODE_CLASS (code) != tcc_comparison) return NULL_TREE; + tree type = TREE_TYPE (TREE_OPERAND (cmpop, 0)); + if (rhs_code == truthop_code) { tree newrhs = merge_truthop_with_opposite_arm (loc, rhs, cmpop, rhs_only); diff --git a/gcc/testsuite/gcc.dg/float_opposite_arm-1.c b/gcc/testsuite/gcc.dg/float_opposite_arm-1.c new file mode 100644 index 000..d2dbff35066 --- /dev/null +++ b/gcc/testsuite/gcc.dg/float_opposite_arm-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-original -fdump-tree-optimized" } */ +/* { dg-add-options ieee } */ +/* PR middle-end/95351 */ + +int Foo(double possiblyNAN, double b, double c) +{ +return (possiblyNAN <= 2.0) || ((possiblyNAN > 2.0) && (b > c)); +} + +/* Make sure we don't remove either >/<= */ + +/* { dg-final { scan-tree-dump "possiblyNAN > 2.0e.0" "original" } } */ +/* { dg-final { scan-tree-dump "possiblyNAN_\[0-9\]+.D. > 2.0e.0" "optimized" } } */ + +/* { dg-final { scan-tree-dump "possiblyNAN <= 2.0e.0" "original" } } */ +/* { dg-final { scan-tree-dump "possiblyNAN_\[0-9\]+.D. <= 2.0e.0" "optimized" } } */