[gcc/aoliva/heads/testme] (171 commits) [libstdc++] [testsuite] avoid async.cc loss of precision [P

2024-07-29 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 9d90ad447ba1... [libstdc++] [testsuite] avoid async.cc loss of precision [P

It previously pointed to:

 110c93a4411d... [strub] adjust all at-calls type variants at once

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  110c93a... [strub] adjust all at-calls type variants at once


Summary of changes (added commits):
---

  9d90ad4... [libstdc++] [testsuite] avoid async.cc loss of precision [P
  ad642d2... [5/n][PR rtl-optimization/115877] Fix handling of input/out (*)
  ad65caa... [powerpc] [testsuite] reorder dg directives [PR106069] (*)
  7c5a9bf... c++/coroutines: correct passing *this to promise type [PR10 (*)
  5d2115b... RISC-V: Implement the .SAT_TRUNC for scalar (*)
  d1b2554... Daily bump. (*)
  efcbe7b... Fix handling of ICF_NOVOPS in ipa-modref (*)
  6f81b7f... c++: Some cp-tree.def comment fixes (*)
  1407477... Fix modref's iteraction with store merging (*)
  05f0e9e... Add -mcpu=power11 support. (*)
  ab7c0ae... [4/n][PR rtl-optimization/115877] Correct SUBREG handling i (*)
  cf8ffc5... Fix modref_eaf_analysis::analyze_ssa_name handling of value (*)
  391f46f... Fix accounting of offsets in unadjusted_ptr_and_unit_offset (*)
  0d19fbc... Compare loop bounds in ipa-icf (*)
  34f33ea... rtl-ssa: Avoid using a stale splay tree root [PR116009] (*)
  e62988b... rtl-ssa: Add debug routines for def_splay_tree (*)
  ebde0cc... aarch64: Tighten aarch64_simd_mem_operand_p [PR115969] (*)
  88d1619... [NFC][PR rtl-optimization/115877] Avoid setting irrelevant  (*)
  a8e61cd... Fix hash of WIDEN_*_EXPR (*)
  1e32a8b... constify inchash (*)
  9d6... Fix Rejects allocatable coarray passed as a dummy argument  (*)
  0c5c0c9... AArch64: implement TARGET_VECTORIZE_CONDITIONAL_OPERATION_I (*)
  af792f0... middle-end: Implement conditonal store vectorizer pattern [ (*)
  913bab2... testsuite: powerpc: fix dg-do run typo (*)
  4ab19e4... RISC-V: Rearrange the test helper files for vector .SAT_* (*)
  3260665... Daily bump. (*)
  838999b... Fortran: Fix regression caused by r14-10477 [PR59104] (*)
  9d8ef27... [PR rtl-optimization/115877][2/n] Improve liveness computat (*)
  91e468b... [PR rtl-optimization/115877] Fix livein computation for ext (*)
  80c3733... gcc: stop adding -fno-common for checking builds (*)
  58b78cf... SH: Fix outage caused by recently added 2nd combine pass af (*)
  6d811c1... Daily bump. (*)
  1824caa... Require bitint575 for pr116003.c (*)
  4a46ba2... Revert "Add documentation for musttail attribute" (*)
  8805ad2... Revert "Add tests for C/C++ musttail attributes" (*)
  53660b1... Revert "C: Implement musttail attribute for returns" (*)
  ff6994e... Revert "C++: Support clang compatible [[musttail]] (PR83324 (*)
  493c555... Output CodeView function information (*)
  7357ba2... Add bitint to options for testcase (*)
  8e3fef3... doc: Remove documentation of two obsolete spec strings (*)
  e0d997e... Avoid undefined behaviour in build_option_suggestions (*)
  56f824c... Add documentation for musttail attribute (*)
  37c4703... Add tests for C/C++ musttail attributes (*)
  7db47f7... C: Implement musttail attribute for returns (*)
  59dd1d7... C++: Support clang compatible [[musttail]] (PR83324) (*)
  5c4c1fe... Add a musttail generic attribute to the c-attribs table (*)
  390c3e4... LoongArch: Organize the code related to split move and merg (*)
  8d6498f... Daily bump. (*)
  01c095a... Check for SSA_NAME not in the IL yet. (*)
  a95c191... libgomp: Document 'GOMP_teams4' (*)
  f911994... GCN: Honor OpenMP 5.1 'num_teams' lower bound (*)
  3850048... Rewrite usage comment at the top of 'gcc/passes.def' (*)
  348d890... Treat boolean vector elements as 0/-1 [PR115406] (*)
  ebdad26... arm: Update fp16-aapcs-[24].c after insn_propagation patch (*)
  2ee70c9... c++: xobj fn call without obj [PR115783] (*)
  9116490... AVR: Support new built-in function __builtin_avr_mask1. (*)
  8d6994f... libgomp: Remove bogus warnings from privatized-ref-2.f90. (*)
  c93be16... Fortran: character array constructor with >= 4 constant ele (*)
  b2f47a5... rs6000: Catch unsupported ABI errors when using -mrop-prote (*)
  58a9f3d... c++: add fixed testcase [PR109464] (*)
  8fbc386... bpf: create modifier for mem operand for xchg and cmpxchg (*)
  cea6473... c++: Add [dcl.init.aggr] examples to testsuite (*)
  a589d3b... Close GCC 11 branch (*)
  0f8261e... c++: Hash placeholder constraint in ctp_hasher (*)
  02cc849... Match: Only allow single use of MIN_EXPR for SAT_TRUNC form (*)
  e20ea6b... Daily bump. (*)
  9846b09... libatomic: Handle AVX+CX16 ZHAOXIN like Intel for 16b atomi (*)
  9690fb3... c++: implement DR1363 and DR1496 for __is_trivial [PR85723] (*)
  248e853... libbacktrace: use __has_attribute for fallthrough (*)
  6962835... rs6000: Fix .machine cpu selection w/ altivec [PR97367] (*)
  c192376... 

[gcc/aoliva/heads/testbase] (170 commits) [5/n][PR rtl-optimization/115877] Fix handling of input/out

2024-07-29 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 ad642d2c9506... [5/n][PR rtl-optimization/115877] Fix handling of input/out

It previously pointed to:

 bf8e80f9d164... [i386] adjust flag_omit_frame_pointer in a single function 

Diff:

Summary of changes (added commits):
---

  ad642d2... [5/n][PR rtl-optimization/115877] Fix handling of input/out (*)
  ad65caa... [powerpc] [testsuite] reorder dg directives [PR106069] (*)
  7c5a9bf... c++/coroutines: correct passing *this to promise type [PR10 (*)
  5d2115b... RISC-V: Implement the .SAT_TRUNC for scalar (*)
  d1b2554... Daily bump. (*)
  efcbe7b... Fix handling of ICF_NOVOPS in ipa-modref (*)
  6f81b7f... c++: Some cp-tree.def comment fixes (*)
  1407477... Fix modref's iteraction with store merging (*)
  05f0e9e... Add -mcpu=power11 support. (*)
  ab7c0ae... [4/n][PR rtl-optimization/115877] Correct SUBREG handling i (*)
  cf8ffc5... Fix modref_eaf_analysis::analyze_ssa_name handling of value (*)
  391f46f... Fix accounting of offsets in unadjusted_ptr_and_unit_offset (*)
  0d19fbc... Compare loop bounds in ipa-icf (*)
  34f33ea... rtl-ssa: Avoid using a stale splay tree root [PR116009] (*)
  e62988b... rtl-ssa: Add debug routines for def_splay_tree (*)
  ebde0cc... aarch64: Tighten aarch64_simd_mem_operand_p [PR115969] (*)
  88d1619... [NFC][PR rtl-optimization/115877] Avoid setting irrelevant  (*)
  a8e61cd... Fix hash of WIDEN_*_EXPR (*)
  1e32a8b... constify inchash (*)
  9d6... Fix Rejects allocatable coarray passed as a dummy argument  (*)
  0c5c0c9... AArch64: implement TARGET_VECTORIZE_CONDITIONAL_OPERATION_I (*)
  af792f0... middle-end: Implement conditonal store vectorizer pattern [ (*)
  913bab2... testsuite: powerpc: fix dg-do run typo (*)
  4ab19e4... RISC-V: Rearrange the test helper files for vector .SAT_* (*)
  3260665... Daily bump. (*)
  838999b... Fortran: Fix regression caused by r14-10477 [PR59104] (*)
  9d8ef27... [PR rtl-optimization/115877][2/n] Improve liveness computat (*)
  91e468b... [PR rtl-optimization/115877] Fix livein computation for ext (*)
  80c3733... gcc: stop adding -fno-common for checking builds (*)
  58b78cf... SH: Fix outage caused by recently added 2nd combine pass af (*)
  6d811c1... Daily bump. (*)
  1824caa... Require bitint575 for pr116003.c (*)
  4a46ba2... Revert "Add documentation for musttail attribute" (*)
  8805ad2... Revert "Add tests for C/C++ musttail attributes" (*)
  53660b1... Revert "C: Implement musttail attribute for returns" (*)
  ff6994e... Revert "C++: Support clang compatible [[musttail]] (PR83324 (*)
  493c555... Output CodeView function information (*)
  7357ba2... Add bitint to options for testcase (*)
  8e3fef3... doc: Remove documentation of two obsolete spec strings (*)
  e0d997e... Avoid undefined behaviour in build_option_suggestions (*)
  56f824c... Add documentation for musttail attribute (*)
  37c4703... Add tests for C/C++ musttail attributes (*)
  7db47f7... C: Implement musttail attribute for returns (*)
  59dd1d7... C++: Support clang compatible [[musttail]] (PR83324) (*)
  5c4c1fe... Add a musttail generic attribute to the c-attribs table (*)
  390c3e4... LoongArch: Organize the code related to split move and merg (*)
  8d6498f... Daily bump. (*)
  01c095a... Check for SSA_NAME not in the IL yet. (*)
  a95c191... libgomp: Document 'GOMP_teams4' (*)
  f911994... GCN: Honor OpenMP 5.1 'num_teams' lower bound (*)
  3850048... Rewrite usage comment at the top of 'gcc/passes.def' (*)
  348d890... Treat boolean vector elements as 0/-1 [PR115406] (*)
  ebdad26... arm: Update fp16-aapcs-[24].c after insn_propagation patch (*)
  2ee70c9... c++: xobj fn call without obj [PR115783] (*)
  9116490... AVR: Support new built-in function __builtin_avr_mask1. (*)
  8d6994f... libgomp: Remove bogus warnings from privatized-ref-2.f90. (*)
  c93be16... Fortran: character array constructor with >= 4 constant ele (*)
  b2f47a5... rs6000: Catch unsupported ABI errors when using -mrop-prote (*)
  58a9f3d... c++: add fixed testcase [PR109464] (*)
  8fbc386... bpf: create modifier for mem operand for xchg and cmpxchg (*)
  cea6473... c++: Add [dcl.init.aggr] examples to testsuite (*)
  a589d3b... Close GCC 11 branch (*)
  0f8261e... c++: Hash placeholder constraint in ctp_hasher (*)
  02cc849... Match: Only allow single use of MIN_EXPR for SAT_TRUNC form (*)
  e20ea6b... Daily bump. (*)
  9846b09... libatomic: Handle AVX+CX16 ZHAOXIN like Intel for 16b atomi (*)
  9690fb3... c++: implement DR1363 and DR1496 for __is_trivial [PR85723] (*)
  248e853... libbacktrace: use __has_attribute for fallthrough (*)
  6962835... rs6000: Fix .machine cpu selection w/ altivec [PR97367] (*)
  c192376... rs6000, update effective target for tests builtins-10*.c an (*)
  f7d01e0... libatomic: Improve cpuid usage in __libat_feat1_init (*)
  1e60a6a... eh: ICE with std::initializer_list and ASan [PR115865] (*)
  5080840... Do not use caller-saved registers for COMDAT 

[gcc r12-10635] [powerpc] [testsuite] reorder dg directives [PR106069]

2024-07-22 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e142b6607267100537fc7abe6f60a52fc0d8535c

commit r12-10635-ge142b6607267100537fc7abe6f60a52fc0d8535c
Author: Alexandre Oliva 
Date:   Tue Jul 23 02:19:55 2024 -0300

[powerpc] [testsuite] reorder dg directives [PR106069]

The dg-do directive appears after dg-require-effective-target in
g++.target/powerpc/pr106069.C.  That doesn't work the way that was
presumably intended.  Both of these directives set dg-do-what, but
dg-do does so fully and unconditionally, overriding any decisions
recorded there by earlier directives.  Reorder the directives more
canonically, so that both take effect.


for  gcc/testsuite/ChangeLog

PR target/106069
* g++.target/powerpc/pr106069.C: Reorder dg directives.

(cherry picked from commit ad65caa332bc7600caff6b9b5b29175b40d91e67)

Diff:
---
 gcc/testsuite/g++.target/powerpc/pr106069.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/powerpc/pr106069.C 
b/gcc/testsuite/g++.target/powerpc/pr106069.C
index 537207d2fe83..826379a4479a 100644
--- a/gcc/testsuite/g++.target/powerpc/pr106069.C
+++ b/gcc/testsuite/g++.target/powerpc/pr106069.C
@@ -1,6 +1,6 @@
+/* { dg-do run } */
 /* { dg-options "-O -fno-tree-forwprop -maltivec" } */
 /* { dg-require-effective-target vmx_hw } */
-/* { dg-do run } */
 
 typedef __attribute__ ((altivec (vector__))) unsigned native_simd_type;


[gcc r13-8934] [powerpc] [testsuite] reorder dg directives [PR106069]

2024-07-22 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e504184f9175204bc66bf5a95a400bc4685f8ffc

commit r13-8934-ge504184f9175204bc66bf5a95a400bc4685f8ffc
Author: Alexandre Oliva 
Date:   Tue Jul 23 01:28:00 2024 -0300

[powerpc] [testsuite] reorder dg directives [PR106069]

The dg-do directive appears after dg-require-effective-target in
g++.target/powerpc/pr106069.C.  That doesn't work the way that was
presumably intended.  Both of these directives set dg-do-what, but
dg-do does so fully and unconditionally, overriding any decisions
recorded there by earlier directives.  Reorder the directives more
canonically, so that both take effect.


for  gcc/testsuite/ChangeLog

PR target/106069
* g++.target/powerpc/pr106069.C: Reorder dg directives.

(cherry picked from commit ad65caa332bc7600caff6b9b5b29175b40d91e67)

Diff:
---
 gcc/testsuite/g++.target/powerpc/pr106069.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/powerpc/pr106069.C 
b/gcc/testsuite/g++.target/powerpc/pr106069.C
index 537207d2fe83..826379a4479a 100644
--- a/gcc/testsuite/g++.target/powerpc/pr106069.C
+++ b/gcc/testsuite/g++.target/powerpc/pr106069.C
@@ -1,6 +1,6 @@
+/* { dg-do run } */
 /* { dg-options "-O -fno-tree-forwprop -maltivec" } */
 /* { dg-require-effective-target vmx_hw } */
-/* { dg-do run } */
 
 typedef __attribute__ ((altivec (vector__))) unsigned native_simd_type;


[gcc r14-10499] [powerpc] [testsuite] reorder dg directives [PR106069]

2024-07-22 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:109b389a0b1528ef7a7c12f0923fb3f5be238f0c

commit r14-10499-g109b389a0b1528ef7a7c12f0923fb3f5be238f0c
Author: Alexandre Oliva 
Date:   Tue Jul 23 00:44:05 2024 -0300

[powerpc] [testsuite] reorder dg directives [PR106069]

The dg-do directive appears after dg-require-effective-target in
g++.target/powerpc/pr106069.C.  That doesn't work the way that was
presumably intended.  Both of these directives set dg-do-what, but
dg-do does so fully and unconditionally, overriding any decisions
recorded there by earlier directives.  Reorder the directives more
canonically, so that both take effect.


for  gcc/testsuite/ChangeLog

PR target/106069
* g++.target/powerpc/pr106069.C: Reorder dg directives.

(cherry picked from commit ad65caa332bc7600caff6b9b5b29175b40d91e67)

Diff:
---
 gcc/testsuite/g++.target/powerpc/pr106069.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/powerpc/pr106069.C 
b/gcc/testsuite/g++.target/powerpc/pr106069.C
index 537207d2fe83..826379a4479a 100644
--- a/gcc/testsuite/g++.target/powerpc/pr106069.C
+++ b/gcc/testsuite/g++.target/powerpc/pr106069.C
@@ -1,6 +1,6 @@
+/* { dg-do run } */
 /* { dg-options "-O -fno-tree-forwprop -maltivec" } */
 /* { dg-require-effective-target vmx_hw } */
-/* { dg-do run } */
 
 typedef __attribute__ ((altivec (vector__))) unsigned native_simd_type;


[gcc r15-2211] [powerpc] [testsuite] reorder dg directives [PR106069]

2024-07-22 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:ad65caa332bc7600caff6b9b5b29175b40d91e67

commit r15-2211-gad65caa332bc7600caff6b9b5b29175b40d91e67
Author: Alexandre Oliva 
Date:   Mon Jul 22 23:09:24 2024 -0300

[powerpc] [testsuite] reorder dg directives [PR106069]

The dg-do directive appears after dg-require-effective-target in
g++.target/powerpc/pr106069.C.  That doesn't work the way that was
presumably intended.  Both of these directives set dg-do-what, but
dg-do does so fully and unconditionally, overriding any decisions
recorded there by earlier directives.  Reorder the directives more
canonically, so that both take effect.


for  gcc/testsuite/ChangeLog

PR target/106069
* g++.target/powerpc/pr106069.C: Reorder dg directives.

Diff:
---
 gcc/testsuite/g++.target/powerpc/pr106069.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/powerpc/pr106069.C 
b/gcc/testsuite/g++.target/powerpc/pr106069.C
index 537207d2fe83..826379a4479a 100644
--- a/gcc/testsuite/g++.target/powerpc/pr106069.C
+++ b/gcc/testsuite/g++.target/powerpc/pr106069.C
@@ -1,6 +1,6 @@
+/* { dg-do run } */
 /* { dg-options "-O -fno-tree-forwprop -maltivec" } */
 /* { dg-require-effective-target vmx_hw } */
-/* { dg-do run } */
 
 typedef __attribute__ ((altivec (vector__))) unsigned native_simd_type;


[gcc r14-10433] [alpha] adjust MEM alignment for block move [PR115459]

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:c8fdef7fc25dafc8c7a12727c1046b3c7f2b89bb

commit r14-10433-gc8fdef7fc25dafc8c7a12727c1046b3c7f2b89bb
Author: Alexandre Oliva 
Date:   Tue Jul 16 08:54:20 2024 -0300

[alpha] adjust MEM alignment for block move [PR115459]

Before issuing loads or stores for a block move, adjust the MEM
alignments if analysis of the addresses enabled the inference of
stricter alignment.  This ensures that the MEMs are sufficiently
aligned for the corresponding insns, which avoids trouble in case of
e.g. substitutions into SUBREGs.


for  gcc/ChangeLog

PR target/115459
* config/alpha/alpha.cc (alpha_expand_block_move): Adjust
MEMs to match inferred alignment.

(cherry picked from commit ccfe7151803956d178947d0afda0bd66ce097275)

Diff:
---
 gcc/config/alpha/alpha.cc | 12 
 1 file changed, 12 insertions(+)

diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index 1126cea1f7ba..e090e74b9d07 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -3820,6 +3820,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
src_align = 16;
}
+
+  if (MEM_P (orig_src) && MEM_ALIGN (orig_src) < src_align)
+   {
+ orig_src = shallow_copy_rtx (orig_src);
+ set_mem_align (orig_src, src_align);
+   }
 }
 
   tmp = XEXP (orig_dst, 0);
@@ -3841,6 +3847,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
dst_align = 16;
}
+
+  if (MEM_P (orig_dst) && MEM_ALIGN (orig_dst) < dst_align)
+   {
+ orig_dst = shallow_copy_rtx (orig_dst);
+ set_mem_align (orig_dst, dst_align);
+   }
 }
 
   ofs = 0;


[gcc(refs/users/aoliva/heads/testme)] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:110c93a4411dbdaf3581364996a7d9760d1247bd

commit 110c93a4411dbdaf3581364996a7d9760d1247bd
Author: Alexandre Oliva 
Date:   Tue Jul 16 05:33:07 2024 -0300

[strub] adjust all at-calls type variants at once

TYPE_ARG_TYPES of type variants must compare equal, according to
verify_type, but adjust_at_calls_type didn't preserve this invariant.

Adjust the main type variant and propagate TYPE_ARG_TYPES to all
variants.  While at that, also adjust the canonical type and its
variants, and then verify_type.


for  gcc/ChangeLog

PR c/115848
* ipa-strub.cc (pass_ipa_strub::adjust_at_calls_type_main):
Rename from...
(pass_ipa_strub::adjust_at_calls_type): ... this.  Preserve
TYPE_ARG_TYPES across all variants.  Adjust TYPE_CANONICAL and
verify_type.

for  gcc/testsuite/ChangeLog

PR c/115848
* c-c++-common/strub-pr115848.c: New.
* c-c++-common/strub-pr115848-b.c: New.

Diff:
---
 gcc/ipa-strub.cc  | 41 +--
 gcc/testsuite/c-c++-common/strub-pr115848-b.c |  6 
 gcc/testsuite/c-c++-common/strub-pr115848.c   |  8 ++
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf53002..15d91c994bf8 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -1891,6 +1891,7 @@ public:
 
 #undef DEF_IDENT
 
+  static inline int adjust_at_calls_type_main (tree);
   static inline int adjust_at_calls_type (tree);
   static inline void adjust_at_calls_call (cgraph_edge *, int, tree);
   static inline void adjust_at_calls_calls (cgraph_node *);
@@ -2348,15 +2349,51 @@ strub_watermark_parm (tree fndecl)
   gcc_unreachable ();
 }
 
+/* Adjust a STRUB_AT_CALLS function TYPE and all its variants,
+   preserving TYPE_ARG_TYPES identity, adding a watermark pointer if
+   it hasn't been added yet.  Return the named argument count.  */
+
+int
+pass_ipa_strub::adjust_at_calls_type (tree type)
+{
+  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+
+  tree tmain = TYPE_MAIN_VARIANT (type);
+  tree orig_types = TYPE_ARG_TYPES (tmain);
+  gcc_checking_assert (TYPE_ARG_TYPES (type) == orig_types);
+  int named_args = adjust_at_calls_type_main (tmain);
+  tree mod_types = TYPE_ARG_TYPES (tmain);
+
+  if (mod_types != orig_types)
+for (tree other = TYPE_NEXT_VARIANT (tmain);
+other != NULL_TREE; other = TYPE_NEXT_VARIANT (other))
+  {
+   gcc_checking_assert (TYPE_ARG_TYPES (other) == orig_types);
+   TYPE_ARG_TYPES (other) = mod_types;
+  }
+
+  if (TYPE_CANONICAL (type)
+  && TYPE_MAIN_VARIANT (TYPE_CANONICAL (type)) != tmain)
+{
+  int ret = adjust_at_calls_type (TYPE_CANONICAL (type));
+  gcc_checking_assert (named_args == ret);
+}
+
+  if (flag_checking)
+verify_type (type);
+
+  return named_args;
+}
+
 /* Adjust a STRUB_AT_CALLS function TYPE, adding a watermark pointer if it
hasn't been added yet.  Return the named argument count.  */
 
 int
-pass_ipa_strub::adjust_at_calls_type (tree type)
+pass_ipa_strub::adjust_at_calls_type_main (tree type)
 {
   int named_args = 0;
 
-  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+  gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type);
 
   if (!TYPE_ARG_TYPES (type))
 return named_args;
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848-b.c 
b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
new file mode 100644
index ..9b9e134b3f41
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
@@ -0,0 +1,6 @@
+/* { dg-skip-if part { *-*-* } } */
+void __attribute__((__strub__)) b(int, int) {}
+void c(void);
+int main() {
+  c();
+}
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848.c 
b/gcc/testsuite/c-c++-common/strub-pr115848.c
new file mode 100644
index ..158654090721
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848.c
@@ -0,0 +1,8 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto" } */
+/* { dg-additional-sources "strub-pr115848-b.c" } */
+
+typedef void __attribute__((__strub__)) a(int, int);
+a(b);
+void c() { b(0, 0); }


[gcc/aoliva/heads/testme] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 110c93a4411d... [strub] adjust all at-calls type variants at once

It previously pointed to:

 e59e3433b03c... [strub] adjust all at-calls type variants at once

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  e59e343... [strub] adjust all at-calls type variants at once


Summary of changes (added commits):
---

  110c93a... [strub] adjust all at-calls type variants at once


[gcc(refs/users/aoliva/heads/testme)] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e59e3433b03cdd8ad9c4670873f5f9749d8a080b

commit e59e3433b03cdd8ad9c4670873f5f9749d8a080b
Author: Alexandre Oliva 
Date:   Tue Jul 16 05:33:07 2024 -0300

[strub] adjust all at-calls type variants at once

TYPE_ARG_TYPES of type variants must compare equal, according to
verify_type, but adjust_at_calls_type didn't preserve this invariant.

Adjust the main type variant and propagate TYPE_ARG_TYPES to all
variants.  While at that, also adjust the canonical type and its
variants, and then verify_type.


for  gcc/ChangeLog

PR c/115848
* ipa-strub.cc (pass_ipa_strub::adjust_at_calls_type_main):
Rename from...
(pass_ipa_strub::adjust_at_calls_type): ... this.  Preserve
TYPE_ARG_TYPES across all variants.  Adjust TYPE_CANONICAL and
verify_type.

for  gcc/testsuite/ChangeLog

PR c/115848
* c-c++-common/strub-pr115848.c: New.
* c-c++-common/strub-pr115848-b.c: New.

Diff:
---
 gcc/ipa-strub.cc  | 41 +--
 gcc/testsuite/c-c++-common/strub-pr115848-b.c |  6 
 gcc/testsuite/c-c++-common/strub-pr115848.c   |  7 +
 3 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf53002..15d91c994bf8 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -1891,6 +1891,7 @@ public:
 
 #undef DEF_IDENT
 
+  static inline int adjust_at_calls_type_main (tree);
   static inline int adjust_at_calls_type (tree);
   static inline void adjust_at_calls_call (cgraph_edge *, int, tree);
   static inline void adjust_at_calls_calls (cgraph_node *);
@@ -2348,15 +2349,51 @@ strub_watermark_parm (tree fndecl)
   gcc_unreachable ();
 }
 
+/* Adjust a STRUB_AT_CALLS function TYPE and all its variants,
+   preserving TYPE_ARG_TYPES identity, adding a watermark pointer if
+   it hasn't been added yet.  Return the named argument count.  */
+
+int
+pass_ipa_strub::adjust_at_calls_type (tree type)
+{
+  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+
+  tree tmain = TYPE_MAIN_VARIANT (type);
+  tree orig_types = TYPE_ARG_TYPES (tmain);
+  gcc_checking_assert (TYPE_ARG_TYPES (type) == orig_types);
+  int named_args = adjust_at_calls_type_main (tmain);
+  tree mod_types = TYPE_ARG_TYPES (tmain);
+
+  if (mod_types != orig_types)
+for (tree other = TYPE_NEXT_VARIANT (tmain);
+other != NULL_TREE; other = TYPE_NEXT_VARIANT (other))
+  {
+   gcc_checking_assert (TYPE_ARG_TYPES (other) == orig_types);
+   TYPE_ARG_TYPES (other) = mod_types;
+  }
+
+  if (TYPE_CANONICAL (type)
+  && TYPE_MAIN_VARIANT (TYPE_CANONICAL (type)) != tmain)
+{
+  int ret = adjust_at_calls_type (TYPE_CANONICAL (type));
+  gcc_checking_assert (named_args == ret);
+}
+
+  if (flag_checking)
+verify_type (type);
+
+  return named_args;
+}
+
 /* Adjust a STRUB_AT_CALLS function TYPE, adding a watermark pointer if it
hasn't been added yet.  Return the named argument count.  */
 
 int
-pass_ipa_strub::adjust_at_calls_type (tree type)
+pass_ipa_strub::adjust_at_calls_type_main (tree type)
 {
   int named_args = 0;
 
-  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+  gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type);
 
   if (!TYPE_ARG_TYPES (type))
 return named_args;
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848-b.c 
b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
new file mode 100644
index ..9b9e134b3f41
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
@@ -0,0 +1,6 @@
+/* { dg-skip-if part { *-*-* } } */
+void __attribute__((__strub__)) b(int, int) {}
+void c(void);
+int main() {
+  c();
+}
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848.c 
b/gcc/testsuite/c-c++-common/strub-pr115848.c
new file mode 100644
index ..97fdecfb0058
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848.c
@@ -0,0 +1,7 @@
+/* { dg-do link } */
+/* { dg-options "-flto" } */
+/* { dg-additional-sources "strub-pr115848-b.c" } */
+
+typedef void __attribute__((__strub__)) a(int, int);
+a(b);
+void c() { b(0, 0); }


[gcc/aoliva/heads/testme] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 e59e3433b03c... [strub] adjust all at-calls type variants at once

It previously pointed to:

 0b2b739ca5bb... [strub] adjust all at-calls type variants at once

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  0b2b739... [strub] adjust all at-calls type variants at once


Summary of changes (added commits):
---

  e59e343... [strub] adjust all at-calls type variants at once


[gcc(refs/users/aoliva/heads/testme)] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0b2b739ca5bbdc9342b4c67d3de816f456877926

commit 0b2b739ca5bbdc9342b4c67d3de816f456877926
Author: Alexandre Oliva 
Date:   Tue Jul 16 05:33:07 2024 -0300

[strub] adjust all at-calls type variants at once

TYPE_ARG_TYPES of type variants must compare equal, according to
verify_type, but adjust_at_calls_type didn't preserve this invariant.

Adjust the main type variant and propagate TYPE_ARG_TYPES to all
variants.  While at that, also adjust the canonical type and its
variants, and then verify_type.


for  gcc/ChangeLog

PR c/115848
* ipa-strub.cc (pass_ipa_strub::adjust_at_calls_type_main):
Rename from...
(pass_ipa_strub::adjust_at_calls_type): ... this.  Preserve
TYPE_ARG_TYPES across all variants.  Adjust TYPE_CANONICAL and
verify_type.

for  gcc/testsuite/ChangeLog

PR c/115848
* c-c++-common/strub-pr115848.c: New.

Diff:
---
 gcc/ipa-strub.cc| 41 +++--
 gcc/testsuite/c-c++-common/strub-pr115848.c |  6 +
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf53002..15d91c994bf8 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -1891,6 +1891,7 @@ public:
 
 #undef DEF_IDENT
 
+  static inline int adjust_at_calls_type_main (tree);
   static inline int adjust_at_calls_type (tree);
   static inline void adjust_at_calls_call (cgraph_edge *, int, tree);
   static inline void adjust_at_calls_calls (cgraph_node *);
@@ -2348,15 +2349,51 @@ strub_watermark_parm (tree fndecl)
   gcc_unreachable ();
 }
 
+/* Adjust a STRUB_AT_CALLS function TYPE and all its variants,
+   preserving TYPE_ARG_TYPES identity, adding a watermark pointer if
+   it hasn't been added yet.  Return the named argument count.  */
+
+int
+pass_ipa_strub::adjust_at_calls_type (tree type)
+{
+  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+
+  tree tmain = TYPE_MAIN_VARIANT (type);
+  tree orig_types = TYPE_ARG_TYPES (tmain);
+  gcc_checking_assert (TYPE_ARG_TYPES (type) == orig_types);
+  int named_args = adjust_at_calls_type_main (tmain);
+  tree mod_types = TYPE_ARG_TYPES (tmain);
+
+  if (mod_types != orig_types)
+for (tree other = TYPE_NEXT_VARIANT (tmain);
+other != NULL_TREE; other = TYPE_NEXT_VARIANT (other))
+  {
+   gcc_checking_assert (TYPE_ARG_TYPES (other) == orig_types);
+   TYPE_ARG_TYPES (other) = mod_types;
+  }
+
+  if (TYPE_CANONICAL (type)
+  && TYPE_MAIN_VARIANT (TYPE_CANONICAL (type)) != tmain)
+{
+  int ret = adjust_at_calls_type (TYPE_CANONICAL (type));
+  gcc_checking_assert (named_args == ret);
+}
+
+  if (flag_checking)
+verify_type (type);
+
+  return named_args;
+}
+
 /* Adjust a STRUB_AT_CALLS function TYPE, adding a watermark pointer if it
hasn't been added yet.  Return the named argument count.  */
 
 int
-pass_ipa_strub::adjust_at_calls_type (tree type)
+pass_ipa_strub::adjust_at_calls_type_main (tree type)
 {
   int named_args = 0;
 
-  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+  gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type);
 
   if (!TYPE_ARG_TYPES (type))
 return named_args;
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848.c 
b/gcc/testsuite/c-c++-common/strub-pr115848.c
new file mode 100644
index ..6c8618dad88a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848.c
@@ -0,0 +1,6 @@
+/* { dg-do link } */
+/* { dg-options "-flto -r" } */
+
+typedef void __attribute__((__strub__)) a(int, int);
+a(b);
+void c() { b(0, 0); }


[gcc/aoliva/heads/testme] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 0b2b739ca5bb... [strub] adjust all at-calls type variants at once

It previously pointed to:

 98c3e8b915af... [strub] adjust all at-calls type variants at once

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  98c3e8b... [strub] adjust all at-calls type variants at once


Summary of changes (added commits):
---

  0b2b739... [strub] adjust all at-calls type variants at once


[gcc(refs/users/aoliva/heads/testme)] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:98c3e8b915af9b76960457a811ce5e3a744029f3

commit 98c3e8b915af9b76960457a811ce5e3a744029f3
Author: Alexandre Oliva 
Date:   Tue Jul 16 05:33:07 2024 -0300

[strub] adjust all at-calls type variants at once

TYPE_ARG_TYPES of type variants must compare equal, according to
verify_type, but adjust_at_calls_type didn't preserve this invariant.

Adjust the main type variant and propagate TYPE_ARG_TYPES to all
variants.  While at that, also adjust the canonical type and its
variants, and then verify_type.


for  gcc/ChangeLog

PR c/115848
* ipa-strub.cc (pass_ipa_strub::adjust_at_calls_type_main):
Rename from...
(pass_ipa_strub::adjust_at_calls_type): ... this.  Preserve
TYPE_ARG_TYPES across all variants.  Adjust TYPE_CANONICAL and
verify_type.

for  gcc/testsuite/ChangeLog

PR c/115848
* c-c++-common/strub-pr115848.c: New.
* c-c++-common/strub-pr115848-b.c: New.

Diff:
---
 gcc/ipa-strub.cc  | 41 +--
 gcc/testsuite/c-c++-common/strub-pr115848-b.c |  2 ++
 gcc/testsuite/c-c++-common/strub-pr115848.c   |  7 +
 3 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf53002..15d91c994bf8 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -1891,6 +1891,7 @@ public:
 
 #undef DEF_IDENT
 
+  static inline int adjust_at_calls_type_main (tree);
   static inline int adjust_at_calls_type (tree);
   static inline void adjust_at_calls_call (cgraph_edge *, int, tree);
   static inline void adjust_at_calls_calls (cgraph_node *);
@@ -2348,15 +2349,51 @@ strub_watermark_parm (tree fndecl)
   gcc_unreachable ();
 }
 
+/* Adjust a STRUB_AT_CALLS function TYPE and all its variants,
+   preserving TYPE_ARG_TYPES identity, adding a watermark pointer if
+   it hasn't been added yet.  Return the named argument count.  */
+
+int
+pass_ipa_strub::adjust_at_calls_type (tree type)
+{
+  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+
+  tree tmain = TYPE_MAIN_VARIANT (type);
+  tree orig_types = TYPE_ARG_TYPES (tmain);
+  gcc_checking_assert (TYPE_ARG_TYPES (type) == orig_types);
+  int named_args = adjust_at_calls_type_main (tmain);
+  tree mod_types = TYPE_ARG_TYPES (tmain);
+
+  if (mod_types != orig_types)
+for (tree other = TYPE_NEXT_VARIANT (tmain);
+other != NULL_TREE; other = TYPE_NEXT_VARIANT (other))
+  {
+   gcc_checking_assert (TYPE_ARG_TYPES (other) == orig_types);
+   TYPE_ARG_TYPES (other) = mod_types;
+  }
+
+  if (TYPE_CANONICAL (type)
+  && TYPE_MAIN_VARIANT (TYPE_CANONICAL (type)) != tmain)
+{
+  int ret = adjust_at_calls_type (TYPE_CANONICAL (type));
+  gcc_checking_assert (named_args == ret);
+}
+
+  if (flag_checking)
+verify_type (type);
+
+  return named_args;
+}
+
 /* Adjust a STRUB_AT_CALLS function TYPE, adding a watermark pointer if it
hasn't been added yet.  Return the named argument count.  */
 
 int
-pass_ipa_strub::adjust_at_calls_type (tree type)
+pass_ipa_strub::adjust_at_calls_type_main (tree type)
 {
   int named_args = 0;
 
-  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+  gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type);
 
   if (!TYPE_ARG_TYPES (type))
 return named_args;
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848-b.c 
b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
new file mode 100644
index ..b88297d4e91b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848-b.c
@@ -0,0 +1,2 @@
+/* { dg-skip-if part { *-*-* } } */
+void __attribute__((__strub__)) b(int, int) {}
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848.c 
b/gcc/testsuite/c-c++-common/strub-pr115848.c
new file mode 100644
index ..97fdecfb0058
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848.c
@@ -0,0 +1,7 @@
+/* { dg-do link } */
+/* { dg-options "-flto" } */
+/* { dg-additional-sources "strub-pr115848-b.c" } */
+
+typedef void __attribute__((__strub__)) a(int, int);
+a(b);
+void c() { b(0, 0); }


[gcc/aoliva/heads/testme] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 98c3e8b915af... [strub] adjust all at-calls type variants at once

It previously pointed to:

 529d91ce3711... [strub] adjust all at-calls type variants at once

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  529d91c... [strub] adjust all at-calls type variants at once


Summary of changes (added commits):
---

  98c3e8b... [strub] adjust all at-calls type variants at once


[gcc r13-8916] [i386] adjust flag_omit_frame_pointer in a single function [PR113719]

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:52959e34c8a7a0473784ca044487d05e791286c1

commit r13-8916-g52959e34c8a7a0473784ca044487d05e791286c1
Author: Alexandre Oliva 
Date:   Tue Jul 16 06:48:36 2024 -0300

[i386] adjust flag_omit_frame_pointer in a single function [PR113719]

The first two patches for PR113719 have each regressed
gcc.dg/ipa/iinline-attr.c on a different target.  The reason for this
instability is that there are competing flag_omit_frame_pointer
overriders on x86:

- ix86_recompute_optlev_based_flags computes and sets a
  -f[no-]omit-frame-pointer default depending on
  USE_IX86_FRAME_POINTER and, in 32-bit mode, optimize_size

- ix86_option_override_internal enables flag_omit_frame_pointer for
  -momit-leaf-frame-pointer to take effect

ix86_option_override[_internal] calls
ix86_recompute_optlev_based_flags before setting
flag_omit_frame_pointer.  It is called during global process_options.

But ix86_recompute_optlev_based_flags is also called by
parse_optimize_options, during attribute processing, and at that
point, ix86_option_override is not called, so the final overrider for
global options is not applied to the optimize attributes.  If they
differ, the testcase fails.

In order to fix this, we need to process all overriders of this option
whenever we process any of them.  Since this setting is affected by
optimization options, it makes sense to compute it in
parse_optimize_options, rather than in process_options.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc (ix86_option_override_internal):
Move flag_omit_frame_pointer final overrider...
(ix86_recompute_optlev_based_flags): ... here.

(cherry picked from commit bf8e80f9d164f8778d86a3dc50e501cf19a9eff1)

Diff:
---
 gcc/config/i386/i386-options.cc | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 4c27e4e01957..a4cff4e615f0 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1868,6 +1868,12 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
opts->x_flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
 }
+
+  /* Keep nonleaf frame pointers.  */
+  if (opts->x_flag_omit_frame_pointer)
+opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
+  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
+opts->x_flag_omit_frame_pointer = 1;
 }
 
 /* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
@@ -2509,12 +2515,6 @@ ix86_option_override_internal (bool main_args_p,
 opts->x_target_flags |= MASK_NO_RED_ZONE;
 }
 
-  /* Keep nonleaf frame pointers.  */
-  if (opts->x_flag_omit_frame_pointer)
-opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
-  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
-opts->x_flag_omit_frame_pointer = 1;
-
   /* If we're doing fast math, we don't care about comparison order
  wrt NaNs.  This lets us use a shorter comparison sequence.  */
   if (opts->x_flag_finite_math_only)


[gcc r13-8915] [i386] restore recompute to override opts after change [PR113719]

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0b9d6829b503cfc72c4271ead2948d8100cce25c

commit r13-8915-g0b9d6829b503cfc72c4271ead2948d8100cce25c
Author: Alexandre Oliva 
Date:   Tue Jul 16 06:48:18 2024 -0300

[i386] restore recompute to override opts after change [PR113719]

The first patch for PR113719 regressed gcc.dg/ipa/iinline-attr.c on
toolchains configured to --enable-frame-pointer, because the
optimization node created within handle_optimize_attribute had
flag_omit_frame_pointer incorrectly set, whereas
default_optimization_node didn't.  With this difference,
can_inline_edge_by_limits_p flagged an optimization mismatch and we
refused to inline the function that had a redundant optimization flag
into one that didn't, which is exactly what is tested for there.

This patch restores the calls to ix86_default_align and
ix86_recompute_optlev_based_flags that used to be, and ought to be,
issued during TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE, but preserves the
intent of the original change, of having those functions called at
different spots within ix86_option_override_internal.  To that end,
the remaining bits were refactored into a separate function, that was
in turn adjusted to operate on explicitly-passed opts and opts_set,
rather than going for their global counterparts.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc
(ix86_override_options_after_change_1): Add opts and opts_set
parms, operate on them, after factoring out of...
(ix86_override_options_after_change): ... this.  Restore calls
of ix86_default_align and ix86_recompute_optlev_based_flags.
(ix86_option_override_internal): Call the factored-out bits.

(cherry picked from commit bf2fc0a27b35de039c3d45e6d7ea9ad0a8a305ba)

Diff:
---
 gcc/config/i386/i386-options.cc | 59 -
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index cdbe2dc62010..4c27e4e01957 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1870,37 +1870,58 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
 }
 }
 
-/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+/* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
 
-void
-ix86_override_options_after_change (void)
+static void
+ix86_override_options_after_change_1 (struct gcc_options *opts,
+ struct gcc_options *opts_set)
 {
+#define OPTS_SET_P(OPTION) opts_set->x_ ## OPTION
+#define OPTS(OPTION) opts->x_ ## OPTION
+
   /* Disable unrolling small loops when there's explicit
  -f{,no}unroll-loop.  */
-  if ((OPTION_SET_P (flag_unroll_loops))
- || (OPTION_SET_P (flag_unroll_all_loops)
-&& flag_unroll_all_loops))
+  if ((OPTS_SET_P (flag_unroll_loops))
+ || (OPTS_SET_P (flag_unroll_all_loops)
+&& OPTS (flag_unroll_all_loops)))
 {
-  if (!OPTION_SET_P (ix86_unroll_only_small_loops))
-   ix86_unroll_only_small_loops = 0;
+  if (!OPTS_SET_P (ix86_unroll_only_small_loops))
+   OPTS (ix86_unroll_only_small_loops) = 0;
   /* Re-enable -frename-registers and -fweb if funroll-loops
 enabled.  */
-  if (!OPTION_SET_P (flag_web))
-   flag_web = flag_unroll_loops;
-  if (!OPTION_SET_P (flag_rename_registers))
-   flag_rename_registers = flag_unroll_loops;
+  if (!OPTS_SET_P (flag_web))
+   OPTS (flag_web) = OPTS (flag_unroll_loops);
+  if (!OPTS_SET_P (flag_rename_registers))
+   OPTS (flag_rename_registers) = OPTS (flag_unroll_loops);
   /* -fcunroll-grow-size default follws -f[no]-unroll-loops.  */
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_unroll_loops
-|| flag_peel_loops
-|| optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_unroll_loops)
+|| OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
   else
 {
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
 
+#undef OPTS
+#undef OPTS_SET_P
+}
+
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+
+void
+ix86_override_options_after_change (void)
+{
+  ix86_default_align (_options);
+
+  ix86_recompute_optlev_based_flags (_options, _options_set);
+
+  ix86_override_options_after_change_1 (_options, _options_set);
 }
 
 /* Clear stack slot assignments remembered from previous functions.
@@ -2417,7 +2438,7 @@ 

[gcc r14-10427] [i386] adjust flag_omit_frame_pointer in a single function [PR113719]

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:7bc63f1c70331763989d72b7df051e0ce67ff84c

commit r14-10427-g7bc63f1c70331763989d72b7df051e0ce67ff84c
Author: Alexandre Oliva 
Date:   Tue Jul 16 06:27:09 2024 -0300

[i386] adjust flag_omit_frame_pointer in a single function [PR113719]

The first two patches for PR113719 have each regressed
gcc.dg/ipa/iinline-attr.c on a different target.  The reason for this
instability is that there are competing flag_omit_frame_pointer
overriders on x86:

- ix86_recompute_optlev_based_flags computes and sets a
  -f[no-]omit-frame-pointer default depending on
  USE_IX86_FRAME_POINTER and, in 32-bit mode, optimize_size

- ix86_option_override_internal enables flag_omit_frame_pointer for
  -momit-leaf-frame-pointer to take effect

ix86_option_override[_internal] calls
ix86_recompute_optlev_based_flags before setting
flag_omit_frame_pointer.  It is called during global process_options.

But ix86_recompute_optlev_based_flags is also called by
parse_optimize_options, during attribute processing, and at that
point, ix86_option_override is not called, so the final overrider for
global options is not applied to the optimize attributes.  If they
differ, the testcase fails.

In order to fix this, we need to process all overriders of this option
whenever we process any of them.  Since this setting is affected by
optimization options, it makes sense to compute it in
parse_optimize_options, rather than in process_options.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc (ix86_option_override_internal):
Move flag_omit_frame_pointer final overrider...
(ix86_recompute_optlev_based_flags): ... here.

(cherry picked from commit bf8e80f9d164f8778d86a3dc50e501cf19a9eff1)

Diff:
---
 gcc/config/i386/i386-options.cc | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 6e8fcbdaa28a..af450dba73dd 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1923,6 +1923,12 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
opts->x_flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
 }
+
+  /* Keep nonleaf frame pointers.  */
+  if (opts->x_flag_omit_frame_pointer)
+opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
+  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
+opts->x_flag_omit_frame_pointer = 1;
 }
 
 /* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
@@ -2623,12 +2629,6 @@ ix86_option_override_internal (bool main_args_p,
 opts->x_target_flags |= MASK_NO_RED_ZONE;
 }
 
-  /* Keep nonleaf frame pointers.  */
-  if (opts->x_flag_omit_frame_pointer)
-opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
-  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
-opts->x_flag_omit_frame_pointer = 1;
-
   /* If we're doing fast math, we don't care about comparison order
  wrt NaNs.  This lets us use a shorter comparison sequence.  */
   if (opts->x_flag_finite_math_only)


[gcc r14-10426] [i386] restore recompute to override opts after change [PR113719]

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:102bcf147892855463c5854119aacda752ed033c

commit r14-10426-g102bcf147892855463c5854119aacda752ed033c
Author: Alexandre Oliva 
Date:   Tue Jul 16 06:27:06 2024 -0300

[i386] restore recompute to override opts after change [PR113719]

The first patch for PR113719 regressed gcc.dg/ipa/iinline-attr.c on
toolchains configured to --enable-frame-pointer, because the
optimization node created within handle_optimize_attribute had
flag_omit_frame_pointer incorrectly set, whereas
default_optimization_node didn't.  With this difference,
can_inline_edge_by_limits_p flagged an optimization mismatch and we
refused to inline the function that had a redundant optimization flag
into one that didn't, which is exactly what is tested for there.

This patch restores the calls to ix86_default_align and
ix86_recompute_optlev_based_flags that used to be, and ought to be,
issued during TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE, but preserves the
intent of the original change, of having those functions called at
different spots within ix86_option_override_internal.  To that end,
the remaining bits were refactored into a separate function, that was
in turn adjusted to operate on explicitly-passed opts and opts_set,
rather than going for their global counterparts.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc
(ix86_override_options_after_change_1): Add opts and opts_set
parms, operate on them, after factoring out of...
(ix86_override_options_after_change): ... this.  Restore calls
of ix86_default_align and ix86_recompute_optlev_based_flags.
(ix86_option_override_internal): Call the factored-out bits.

(cherry picked from commit bf2fc0a27b35de039c3d45e6d7ea9ad0a8a305ba)

Diff:
---
 gcc/config/i386/i386-options.cc | 59 -
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index d97464f2c74b..6e8fcbdaa28a 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1925,37 +1925,58 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
 }
 }
 
-/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+/* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
 
-void
-ix86_override_options_after_change (void)
+static void
+ix86_override_options_after_change_1 (struct gcc_options *opts,
+ struct gcc_options *opts_set)
 {
+#define OPTS_SET_P(OPTION) opts_set->x_ ## OPTION
+#define OPTS(OPTION) opts->x_ ## OPTION
+
   /* Disable unrolling small loops when there's explicit
  -f{,no}unroll-loop.  */
-  if ((OPTION_SET_P (flag_unroll_loops))
- || (OPTION_SET_P (flag_unroll_all_loops)
-&& flag_unroll_all_loops))
+  if ((OPTS_SET_P (flag_unroll_loops))
+ || (OPTS_SET_P (flag_unroll_all_loops)
+&& OPTS (flag_unroll_all_loops)))
 {
-  if (!OPTION_SET_P (ix86_unroll_only_small_loops))
-   ix86_unroll_only_small_loops = 0;
+  if (!OPTS_SET_P (ix86_unroll_only_small_loops))
+   OPTS (ix86_unroll_only_small_loops) = 0;
   /* Re-enable -frename-registers and -fweb if funroll-loops
 enabled.  */
-  if (!OPTION_SET_P (flag_web))
-   flag_web = flag_unroll_loops;
-  if (!OPTION_SET_P (flag_rename_registers))
-   flag_rename_registers = flag_unroll_loops;
+  if (!OPTS_SET_P (flag_web))
+   OPTS (flag_web) = OPTS (flag_unroll_loops);
+  if (!OPTS_SET_P (flag_rename_registers))
+   OPTS (flag_rename_registers) = OPTS (flag_unroll_loops);
   /* -fcunroll-grow-size default follws -f[no]-unroll-loops.  */
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_unroll_loops
-|| flag_peel_loops
-|| optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_unroll_loops)
+|| OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
   else
 {
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
 
+#undef OPTS
+#undef OPTS_SET_P
+}
+
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+
+void
+ix86_override_options_after_change (void)
+{
+  ix86_default_align (_options);
+
+  ix86_recompute_optlev_based_flags (_options, _options_set);
+
+  ix86_override_options_after_change_1 (_options, _options_set);
 }
 
 /* Clear stack slot assignments remembered from previous functions.
@@ -2527,7 +2548,7 @@ 

[gcc(refs/users/aoliva/heads/testme)] [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:529d91ce3711739c56a502cdf7d6b7b657776c3d

commit 529d91ce3711739c56a502cdf7d6b7b657776c3d
Author: Alexandre Oliva 
Date:   Tue Jul 16 05:33:07 2024 -0300

[strub] adjust all at-calls type variants at once

TYPE_ARG_TYPES of type variants must compare equal, according to
verify_type, but adjust_at_calls_type didn't preserve this invariant.

Adjust the main type variant and propagate TYPE_ARG_TYPES to all
variants.  While at that, also adjust the canonical type and its
variants, and then verify_type.


for  gcc/ChangeLog

PR c/115848
* ipa-strub.cc (pass_ipa_strub::adjust_at_calls_type_main):
Rename from...
(pass_ipa_strub::adjust_at_calls_type): ... this.  Preserve
TYPE_ARG_TYPES across all variants.  Adjust TYPE_CANONICAL and
verify_type.

for  gcc/testsuite/ChangeLog

PR c/115848
* c-c++-common/strub-pr115848.c: New.

Diff:
---
 gcc/ipa-strub.cc| 41 +++--
 gcc/testsuite/c-c++-common/strub-pr115848.c |  6 +
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf53002..15d91c994bf8 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -1891,6 +1891,7 @@ public:
 
 #undef DEF_IDENT
 
+  static inline int adjust_at_calls_type_main (tree);
   static inline int adjust_at_calls_type (tree);
   static inline void adjust_at_calls_call (cgraph_edge *, int, tree);
   static inline void adjust_at_calls_calls (cgraph_node *);
@@ -2348,15 +2349,51 @@ strub_watermark_parm (tree fndecl)
   gcc_unreachable ();
 }
 
+/* Adjust a STRUB_AT_CALLS function TYPE and all its variants,
+   preserving TYPE_ARG_TYPES identity, adding a watermark pointer if
+   it hasn't been added yet.  Return the named argument count.  */
+
+int
+pass_ipa_strub::adjust_at_calls_type (tree type)
+{
+  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+
+  tree tmain = TYPE_MAIN_VARIANT (type);
+  tree orig_types = TYPE_ARG_TYPES (tmain);
+  gcc_checking_assert (TYPE_ARG_TYPES (type) == orig_types);
+  int named_args = adjust_at_calls_type_main (tmain);
+  tree mod_types = TYPE_ARG_TYPES (tmain);
+
+  if (mod_types != orig_types)
+for (tree other = TYPE_NEXT_VARIANT (tmain);
+other != NULL_TREE; other = TYPE_NEXT_VARIANT (other))
+  {
+   gcc_checking_assert (TYPE_ARG_TYPES (other) == orig_types);
+   TYPE_ARG_TYPES (other) = mod_types;
+  }
+
+  if (TYPE_CANONICAL (type)
+  && TYPE_MAIN_VARIANT (TYPE_CANONICAL (type)) != tmain)
+{
+  int ret = adjust_at_calls_type (TYPE_CANONICAL (type));
+  gcc_checking_assert (named_args == ret);
+}
+
+  if (flag_checking)
+verify_type (type);
+
+  return named_args;
+}
+
 /* Adjust a STRUB_AT_CALLS function TYPE, adding a watermark pointer if it
hasn't been added yet.  Return the named argument count.  */
 
 int
-pass_ipa_strub::adjust_at_calls_type (tree type)
+pass_ipa_strub::adjust_at_calls_type_main (tree type)
 {
   int named_args = 0;
 
-  gcc_checking_assert (same_strub_mode_in_variants_p (type));
+  gcc_checking_assert (TYPE_MAIN_VARIANT (type) == type);
 
   if (!TYPE_ARG_TYPES (type))
 return named_args;
diff --git a/gcc/testsuite/c-c++-common/strub-pr115848.c 
b/gcc/testsuite/c-c++-common/strub-pr115848.c
new file mode 100644
index ..658dbaafe01d
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr115848.c
@@ -0,0 +1,6 @@
+/* { dg-do link } */
+/* { dg-options "-flto" } */
+
+typedef void __attribute__((__strub__)) a(int, int);
+a(b);
+void c() { b(0, 0); }


[gcc/aoliva/heads/testbase] (81 commits) [i386] adjust flag_omit_frame_pointer in a single function

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 bf8e80f9d164... [i386] adjust flag_omit_frame_pointer in a single function 

It previously pointed to:

 36e5e409190e... RISC-V: c implies zca, and conditionally zcf & zcd

Diff:

Summary of changes (added commits):
---

  bf8e80f... [i386] adjust flag_omit_frame_pointer in a single function  (*)
  4306f76... RISC-V: Fix testcase for vector .SAT_SUB in zip benchmark (*)
  8f87b3c... AVR: avr-md - Simplify GET_MODE and GET_MODE_BITSIZE. (*)
  9964edf... varasm: Add support for emitting binary data with the new g (*)
  f27bf48... Fix SSA_NAME leak due to def_stmt is removed before use_stm (*)
  681ff5c... [APX NF] Add a pass to convert legacy insn to NF insns (*)
  60ba989... arm: Fix the expected output of the test pr111235.c  [PR115 (*)
  bf26413... RISC-V: Implement locality for __builtin_prefetch (*)
  8b14920... aarch64: Fix the expected output of the test cpy_1.c [PR115 (*)
  da37a27... CRIS: Adjust gcc.dg/tree-ssa/loop-1.c (*)
  9f52163... RISC-V: Add md files for vector BFloat16 (*)
  281f021... RISC-V: Add Zvfbfmin and Zvfbfwma intrinsic (*)
  02a3bf5... AVX512BF16: Do not allow permutation with vcvtne2ps2bf16 [P (*)
  666f167... RISC-V: Add vector type of BFloat16 format (*)
  8ccfa57... Daily bump. (*)
  74e6dfb... i386: Tweak i386-expand.cc to restore bootstrap on RHEL. (*)
  44c9403... c, objc: Add -Wunterminated-string-initialization (*)
  74595c7... CRIS: Fix up last comment. (*)
  a01b40c... CRIS: Disable late-combine by default, related PR115883 (*)
  944e425... Daily bump. (*)
  677ef11... Document return value in write_cv_integer (*)
  800e06c... Make sure CodeView symbols are aligned (*)
  45a4f34... Avoid magic numbers when writing CodeView padding (*)
  f53087a... Add CodeView enum cv_sym_type (*)
  131fcb5... Add CodeView enum cv_leaf_type (*)
  d211100... fortran: Correctly evaluate scalar MASK arguments of MINLOC (*)
  6fc24a0... Add gcc.gnu.org account names to MAINTAINERS (*)
  7d73c01... diagnostics: add highlight-a vs highlight-b in colorization (*)
  abf3964... tree-optimization/115868 - ICE with .MASK_CALL in simdclone (*)
  2ee5b58... Daily bump. (*)
  dd2840a... doc: Update GNU Modula 2 mailing list links (*)
  a6f551d... [PR rtl-optimization/115876] Fix one of two ubsan reported  (*)
  b3d4a02... doc: remove @opindex for fconcepts-ts (*)
  08776be... Fix Xcode 16 build break with NULL != nullptr (*)
  6e7053a... rtl-ssa: Fix prev_any_insn [PR115785] (*)
  f4047a8... modula2: bootstrap fix for string and vector headers. (*)
  ae829a2... [RISC-V] Avoid unnecessary sign extension after memcmp (*)
  13757e5... c++/modules: Add testcase for fixed issue with usings [PR11 (*)
  1f7a21c... c++/modules: Handle redefinitions of using-decls (*)
  d6bf4b1... c++: Introduce USING_DECLs for non-function usings [PR11468 (*)
  61715e9... s390: Fully exploit vgm, vgbm, vrepi (*)
  e6680d3... s390: Fix output template for movv1qi (*)
  6b5d263... i386: Some AVX512 ternlog expansion refinements. (*)
  56de68a... s390: Align *cjump_64 and *icjump_64 (*)
  7bcef75... aarch64: Avoid alloca in target attribute parsing (*)
  26dfb3f... [libstdc++] [testsuite] require dfprt on some tests (*)
  ccfe715... [alpha] adjust MEM alignment for block move [PR115459] (*)
  c6f38e5... RISC-V: NO_WARNING preferred else value for RVV (*)
  a55d24b... fortran: Factor the evaluation of MINLOC/MAXLOC's BACK argu (*)
  63d7d59... RISC-V: Disable misaligned vector access in hook riscv_slow (*)
  3ea47ea... RISC-V: Add SiFive extensions, xsfvcp and xsfcease (*)
  f7e4000... rs6000: Remove vcond{,u} expanders (*)
  4f4478f... tree-optimization/115867 - ICE with simdcall vectorization  (*)
  a91c51c... [committed] Fix m68k bootstrap segfault with late-combine (*)
  bf406a5... libbacktrace: avoid infinite recursion (*)
  3bc1a86... LoongArch: Remove unreachable codes. (*)
  abeb6c8... LoongArch: TFmode is not allowed to be stored in the float  (*)
  d7318f4... libbacktrace: don't fail if symbol size is unknown (*)
  b870086... libbacktrace: correctly gather Mach-O symbol table (*)
  88ff050... Daily bump. (*)
  8f7c06d... libbacktrace: fix testsuite for clang (*)
  43763bd... libstdc++: Test that std::atomic_ref uses the primary (*)
  79d3f17... libstdc++: the specialization atomic_ref should use t (*)
  b96789a... libbacktrace: suggest how to fix missing debug info (*)
  02f7525... libbacktrace: remove trailing whitespace (*)
  26c9b09... libstdc++: Switch gcc.gnu.org links to https (*)
  74d8acc... [to-be-committed,RISC-V] Eliminate unnecessary sign extensi (*)
  4e0aa05... Ranger: Mark a few classes as final (*)
  8dbc02b... libstdc++: Disable expensive test for debug mode [PR108636] (*)
  7c11fdd... mve: Fix vsetq_lane for 64-bit elements with lane 1 [PR 115 (*)
  44fc801... recog: Avoid validate_change shortcut for groups [PR115782] (*)
  b9513c6... Fix bootstrap broken by gcc-15-1965-ge4f2f46e015 (*)
  7387117... Fix 

[gcc/aoliva/heads/testme] (82 commits) [strub] adjust all at-calls type variants at once

2024-07-16 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 529d91ce3711... [strub] adjust all at-calls type variants at once

It previously pointed to:

 3b1df5149519... [analyzer] [testsuite] avoid unexpected null dereference wa

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  3b1df51... [analyzer] [testsuite] avoid unexpected null dereference wa
  2f1f926... [libstdc++] [testsuite] avoid arbitrary errno codes
  35b8b9a... [libstdc++] [testsuite] require dfprt on some tests
  e7140d9... [libstdc++] [testsuite] xfail 128bit from_chars on all aarc
  ef1d9ef... [i386] adjust flag_omit_frame_pointer in a single function 


Summary of changes (added commits):
---

  529d91c... [strub] adjust all at-calls type variants at once
  bf8e80f... [i386] adjust flag_omit_frame_pointer in a single function  (*)
  4306f76... RISC-V: Fix testcase for vector .SAT_SUB in zip benchmark (*)
  8f87b3c... AVR: avr-md - Simplify GET_MODE and GET_MODE_BITSIZE. (*)
  9964edf... varasm: Add support for emitting binary data with the new g (*)
  f27bf48... Fix SSA_NAME leak due to def_stmt is removed before use_stm (*)
  681ff5c... [APX NF] Add a pass to convert legacy insn to NF insns (*)
  60ba989... arm: Fix the expected output of the test pr111235.c  [PR115 (*)
  bf26413... RISC-V: Implement locality for __builtin_prefetch (*)
  8b14920... aarch64: Fix the expected output of the test cpy_1.c [PR115 (*)
  da37a27... CRIS: Adjust gcc.dg/tree-ssa/loop-1.c (*)
  9f52163... RISC-V: Add md files for vector BFloat16 (*)
  281f021... RISC-V: Add Zvfbfmin and Zvfbfwma intrinsic (*)
  02a3bf5... AVX512BF16: Do not allow permutation with vcvtne2ps2bf16 [P (*)
  666f167... RISC-V: Add vector type of BFloat16 format (*)
  8ccfa57... Daily bump. (*)
  74e6dfb... i386: Tweak i386-expand.cc to restore bootstrap on RHEL. (*)
  44c9403... c, objc: Add -Wunterminated-string-initialization (*)
  74595c7... CRIS: Fix up last comment. (*)
  a01b40c... CRIS: Disable late-combine by default, related PR115883 (*)
  944e425... Daily bump. (*)
  677ef11... Document return value in write_cv_integer (*)
  800e06c... Make sure CodeView symbols are aligned (*)
  45a4f34... Avoid magic numbers when writing CodeView padding (*)
  f53087a... Add CodeView enum cv_sym_type (*)
  131fcb5... Add CodeView enum cv_leaf_type (*)
  d211100... fortran: Correctly evaluate scalar MASK arguments of MINLOC (*)
  6fc24a0... Add gcc.gnu.org account names to MAINTAINERS (*)
  7d73c01... diagnostics: add highlight-a vs highlight-b in colorization (*)
  abf3964... tree-optimization/115868 - ICE with .MASK_CALL in simdclone (*)
  2ee5b58... Daily bump. (*)
  dd2840a... doc: Update GNU Modula 2 mailing list links (*)
  a6f551d... [PR rtl-optimization/115876] Fix one of two ubsan reported  (*)
  b3d4a02... doc: remove @opindex for fconcepts-ts (*)
  08776be... Fix Xcode 16 build break with NULL != nullptr (*)
  6e7053a... rtl-ssa: Fix prev_any_insn [PR115785] (*)
  f4047a8... modula2: bootstrap fix for string and vector headers. (*)
  ae829a2... [RISC-V] Avoid unnecessary sign extension after memcmp (*)
  13757e5... c++/modules: Add testcase for fixed issue with usings [PR11 (*)
  1f7a21c... c++/modules: Handle redefinitions of using-decls (*)
  d6bf4b1... c++: Introduce USING_DECLs for non-function usings [PR11468 (*)
  61715e9... s390: Fully exploit vgm, vgbm, vrepi (*)
  e6680d3... s390: Fix output template for movv1qi (*)
  6b5d263... i386: Some AVX512 ternlog expansion refinements. (*)
  56de68a... s390: Align *cjump_64 and *icjump_64 (*)
  7bcef75... aarch64: Avoid alloca in target attribute parsing (*)
  26dfb3f... [libstdc++] [testsuite] require dfprt on some tests (*)
  ccfe715... [alpha] adjust MEM alignment for block move [PR115459] (*)
  c6f38e5... RISC-V: NO_WARNING preferred else value for RVV (*)
  a55d24b... fortran: Factor the evaluation of MINLOC/MAXLOC's BACK argu (*)
  63d7d59... RISC-V: Disable misaligned vector access in hook riscv_slow (*)
  3ea47ea... RISC-V: Add SiFive extensions, xsfvcp and xsfcease (*)
  f7e4000... rs6000: Remove vcond{,u} expanders (*)
  4f4478f... tree-optimization/115867 - ICE with simdcall vectorization  (*)
  a91c51c... [committed] Fix m68k bootstrap segfault with late-combine (*)
  bf406a5... libbacktrace: avoid infinite recursion (*)
  3bc1a86... LoongArch: Remove unreachable codes. (*)
  abeb6c8... LoongArch: TFmode is not allowed to be stored in the float  (*)
  d7318f4... libbacktrace: don't fail if symbol size is unknown (*)
  b870086... libbacktrace: correctly gather Mach-O symbol table (*)
  88ff050... Daily bump. (*)
  8f7c06d... libbacktrace: fix testsuite for clang (*)
  43763bd... libstdc++: Test that std::atomic_ref uses the primary (*)
  79d3f17... libstdc++: the specialization atomic_ref should use t (*)
  b96789a... libbacktrace: suggest how to fix missing debug info (*)
  02f7525... 

[gcc r15-2042] [i386] adjust flag_omit_frame_pointer in a single function [PR113719]

2024-07-15 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:bf8e80f9d164f8778d86a3dc50e501cf19a9eff1

commit r15-2042-gbf8e80f9d164f8778d86a3dc50e501cf19a9eff1
Author: Alexandre Oliva 
Date:   Mon Jul 15 14:00:36 2024 -0300

[i386] adjust flag_omit_frame_pointer in a single function [PR113719]

The first two patches for PR113719 have each regressed
gcc.dg/ipa/iinline-attr.c on a different target.  The reason for this
instability is that there are competing flag_omit_frame_pointer
overriders on x86:

- ix86_recompute_optlev_based_flags computes and sets a
  -f[no-]omit-frame-pointer default depending on
  USE_IX86_FRAME_POINTER and, in 32-bit mode, optimize_size

- ix86_option_override_internal enables flag_omit_frame_pointer for
  -momit-leaf-frame-pointer to take effect

ix86_option_override[_internal] calls
ix86_recompute_optlev_based_flags before setting
flag_omit_frame_pointer.  It is called during global process_options.

But ix86_recompute_optlev_based_flags is also called by
parse_optimize_options, during attribute processing, and at that
point, ix86_option_override is not called, so the final overrider for
global options is not applied to the optimize attributes.  If they
differ, the testcase fails.

In order to fix this, we need to process all overriders of this option
whenever we process any of them.  Since this setting is affected by
optimization options, it makes sense to compute it in
parse_optimize_options, rather than in process_options.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc (ix86_option_override_internal):
Move flag_omit_frame_pointer final overrider...
(ix86_recompute_optlev_based_flags): ... here.

Diff:
---
 gcc/config/i386/i386-options.cc | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 5824c0cb072e..059ef3ae6ad4 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1911,6 +1911,12 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
opts->x_flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
 }
+
+  /* Keep nonleaf frame pointers.  */
+  if (opts->x_flag_omit_frame_pointer)
+opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
+  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
+opts->x_flag_omit_frame_pointer = 1;
 }
 
 /* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
@@ -2590,12 +2596,6 @@ ix86_option_override_internal (bool main_args_p,
 opts->x_target_flags |= MASK_NO_RED_ZONE;
 }
 
-  /* Keep nonleaf frame pointers.  */
-  if (opts->x_flag_omit_frame_pointer)
-opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
-  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
-opts->x_flag_omit_frame_pointer = 1;
-
   /* If we're doing fast math, we don't care about comparison order
  wrt NaNs.  This lets us use a shorter comparison sequence.  */
   if (opts->x_flag_finite_math_only)


[gcc r15-1997] [libstdc++] [testsuite] require dfprt on some tests

2024-07-12 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:26dfb3f2d30f6d49ed126add9d123dcc6566385f

commit r15-1997-g26dfb3f2d30f6d49ed126add9d123dcc6566385f
Author: Alexandre Oliva 
Date:   Fri Jul 12 05:42:19 2024 -0300

[libstdc++] [testsuite] require dfprt on some tests

On a target that doesn't enable decimal float components in libgcc
(because the libc doens't define all required FE_* macros), but whose
compiler supports _Decimal* types, the effective target requirement
dfp passes, but several tests won't link because the runtime support
they depend on is missing.  State their dfprt requirement.


for  libstdc++-v3/ChangeLog

* testsuite/decimal/binary-arith.cc: Require dfprt.
* testsuite/decimal/comparison.cc: Likewise.
* testsuite/decimal/compound-assignment.cc: Likewise.
* testsuite/decimal/compound-assignment-memfunc.cc: Likewise.
* testsuite/decimal/make-decimal.cc: Likewise.
* testsuite/decimal/pr54036-1.cc: Likewise.
* testsuite/decimal/pr54036-2.cc: Likewise.
* testsuite/decimal/pr54036-3.cc: Likewise.
* testsuite/decimal/unary-arith.cc: Likewise.

Diff:
---
 libstdc++-v3/testsuite/decimal/binary-arith.cc| 2 +-
 libstdc++-v3/testsuite/decimal/comparison.cc  | 2 +-
 libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc | 2 +-
 libstdc++-v3/testsuite/decimal/compound-assignment.cc | 2 +-
 libstdc++-v3/testsuite/decimal/make-decimal.cc| 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-1.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-2.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-3.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/unary-arith.cc | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libstdc++-v3/testsuite/decimal/binary-arith.cc 
b/libstdc++-v3/testsuite/decimal/binary-arith.cc
index c10a8b6466cb..3eeed7ea9750 100644
--- a/libstdc++-v3/testsuite/decimal/binary-arith.cc
+++ b/libstdc++-v3/testsuite/decimal/binary-arith.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.8  Binary arithmetic operators.
 
diff --git a/libstdc++-v3/testsuite/decimal/comparison.cc 
b/libstdc++-v3/testsuite/decimal/comparison.cc
index cf34c8d74bad..424dd8bd2665 100644
--- a/libstdc++-v3/testsuite/decimal/comparison.cc
+++ b/libstdc++-v3/testsuite/decimal/comparison.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.9  Comparison operators.
 
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc 
b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
index 817d4bb10b1e..d520af9a68d4 100644
--- a/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.2.6  Compound assignment (decimal32).
 // ISO/IEC TR 24733  3.2.3.6  Compound assignment (decimal64).
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment.cc 
b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
index 2d3e32585698..5aa87e78a739 100644
--- a/libstdc++-v3/testsuite/decimal/compound-assignment.cc
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.2.6  Compound assignment (decimal32).
 // ISO/IEC TR 24733  3.2.3.6  Compound assignment (decimal64).
diff --git a/libstdc++-v3/testsuite/decimal/make-decimal.cc 
b/libstdc++-v3/testsuite/decimal/make-decimal.cc
index aa75ac89d479..560196cb305e 100644
--- a/libstdc++-v3/testsuite/decimal/make-decimal.cc
+++ b/libstdc++-v3/testsuite/decimal/make-decimal.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 // { dg-options "-Wno-pedantic" }
 
 // ISO/IEC TR 24733  3.2.5  Initialization from coefficient and exponent.
diff --git a/libstdc++-v3/testsuite/decimal/pr54036-1.cc 
b/libstdc++-v3/testsuite/decimal/pr54036-1.cc
index 508738701ca0..a07e4c351651 100644
--- a/libstdc++-v3/testsuite/decimal/pr54036-1.cc
+++ b/libstdc++-v3/testsuite/decimal/pr54036-1.cc
@@ -15,7 +15,7 @@
 // with this 

[gcc r15-1996] [alpha] adjust MEM alignment for block move [PR115459]

2024-07-12 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:ccfe7151803956d178947d0afda0bd66ce097275

commit r15-1996-gccfe7151803956d178947d0afda0bd66ce097275
Author: Alexandre Oliva 
Date:   Fri Jul 12 05:42:07 2024 -0300

[alpha] adjust MEM alignment for block move [PR115459]

Before issuing loads or stores for a block move, adjust the MEM
alignments if analysis of the addresses enabled the inference of
stricter alignment.  This ensures that the MEMs are sufficiently
aligned for the corresponding insns, which avoids trouble in case of
e.g. substitutions into SUBREGs.


for  gcc/ChangeLog

PR target/115459
* config/alpha/alpha.cc (alpha_expand_block_move): Adjust
MEMs to match inferred alignment.

Diff:
---
 gcc/config/alpha/alpha.cc | 12 
 1 file changed, 12 insertions(+)

diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index a6fe95e71778..74631a416935 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -3820,6 +3820,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
src_align = 16;
}
+
+  if (MEM_P (orig_src) && MEM_ALIGN (orig_src) < src_align)
+   {
+ orig_src = shallow_copy_rtx (orig_src);
+ set_mem_align (orig_src, src_align);
+   }
 }
 
   tmp = XEXP (orig_dst, 0);
@@ -3841,6 +3847,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
dst_align = 16;
}
+
+  if (MEM_P (orig_dst) && MEM_ALIGN (orig_dst) < dst_align)
+   {
+ orig_dst = shallow_copy_rtx (orig_dst);
+ set_mem_align (orig_dst, dst_align);
+   }
 }
 
   ofs = 0;


[gcc(refs/users/aoliva/heads/testme)] [libstdc++] [testsuite] avoid arbitrary errno codes

2024-07-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:2f1f926425b4e3cd5e7e48b86e03bb3613b5aa54

commit 2f1f926425b4e3cd5e7e48b86e03bb3613b5aa54
Author: Alexandre Oliva 
Date:   Thu Jul 11 09:04:11 2024 -0300

[libstdc++] [testsuite] avoid arbitrary errno codes

Passing an arbitrary error number to strerror* functions doesn't seem
to be portable; 19_diagnostics/system_error/cons-1.cc is hitting
runtime errors in the block that attempts to instantiate a
std:;system_error for error number 95.  The range of errno macros
defined on this target doesn't reach 95.

I'm changing the test to try to use a couple of select error codes,
falling back to a lower error number if neither are present.
Hopefully this doesn't change the nature of what is being tested for.


for  libstdc++-v3/ChangeLog

* testsuite/19_diagnostics/system_error/cons-1.cc: Use lower
error numbers, preferring some macro-defined ones.

Diff:
---
 .../testsuite/19_diagnostics/system_error/cons-1.cc| 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/19_diagnostics/system_error/cons-1.cc 
b/libstdc++-v3/testsuite/19_diagnostics/system_error/cons-1.cc
index 16aa960b2ee2..e227c6754241 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/system_error/cons-1.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/system_error/cons-1.cc
@@ -37,8 +37,18 @@ int main()
 
   // 2
   {
-std::system_error err2(95, std::system_category(), s);
-VERIFY( err2.code() == std::error_code(95, std::system_category()) );
+int eno;
+#if defined EOPNOTSUPP
+eno = EOPNOTSUPP;
+#elif defined ENOSYS
+eno = ENOSYS;
+#else
+// strerror (used to combine with the given message) may fail if
+// the error number is out of range for the system.
+eno = 42;
+#endif
+std::system_error err2(eno, std::system_category(), s);
+VERIFY( err2.code() == std::error_code(eno, std::system_category()) );
 VERIFY( std::string((err2.what(), s)).find(s) != std::string::npos );
   }


[gcc(refs/users/aoliva/heads/testme)] [analyzer] [testsuite] avoid unexpected null dereference warning

2024-07-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:3b1df514951940298acd6b602f629027066af1c0

commit 3b1df514951940298acd6b602f629027066af1c0
Author: Alexandre Oliva 
Date:   Thu Jul 11 09:04:38 2024 -0300

[analyzer] [testsuite] avoid unexpected null dereference warning

The analyzer testsuite, on a customer's own operating system, reports
a potential NULL pointer dereference in flex-without-call-summaries.c.
I'm not sure why it shows up on that system, but not on others, but
the test is not meant to test for that warning, so I'm silencing it.


for  gcc/testsuite/ChangeLog

* c-c++-common/analyzer/flex-without-call-summaries.c: Disable
null dereference analyzer warnings.

Diff:
---
 gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c 
b/gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c
index c6ecb25d25d5..1aad2bc896b7 100644
--- a/gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c
+++ b/gcc/testsuite/c-c++-common/analyzer/flex-without-call-summaries.c
@@ -3,6 +3,7 @@
 
 /* { dg-additional-options "-fno-analyzer-call-summaries" } */
 
+/* { dg-additional-options "-Wno-analyzer-null-dereference" } */
 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
 /* { dg-additional-options "-D_POSIX_SOURCE" } */


[gcc(refs/users/aoliva/heads/testme)] [libstdc++] [testsuite] require dfprt on some tests

2024-07-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:35b8b9ad5a3db3089074fc7c9cd7b91b9fd5cedf

commit 35b8b9ad5a3db3089074fc7c9cd7b91b9fd5cedf
Author: Alexandre Oliva 
Date:   Thu Jul 11 09:04:02 2024 -0300

[libstdc++] [testsuite] require dfprt on some tests

On a target that doesn't enable decimal float components in libgcc
(because the libc doens't define all required FE_* macros), but whose
compiler supports _Decimal* types, the effective target requirement
dfp passes, but several tests won't link because the runtime support
they depend on is missing.  State their dfprt requirement.


for  libstdc++-v3/ChangeLog

* testsuite/decimal/binary-arith.cc: Require dfprt.
* testsuite/decimal/comparison.cc: Likewise.
* testsuite/decimal/compound-assignment-memfunc.cc: Likewise.
* testsuite/decimal/make-decimal.cc: Likewise.
* testsuite/decimal/pr54036-1.cc: Likewise.
* testsuite/decimal/pr54036-2.cc: Likewise.
* testsuite/decimal/pr54036-3.cc: Likewise.
* testsuite/decimal/unary-arith.cc: Likewise.

Diff:
---
 libstdc++-v3/testsuite/decimal/binary-arith.cc| 2 +-
 libstdc++-v3/testsuite/decimal/comparison.cc  | 2 +-
 libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc | 2 +-
 libstdc++-v3/testsuite/decimal/compound-assignment.cc | 2 +-
 libstdc++-v3/testsuite/decimal/make-decimal.cc| 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-1.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-2.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/pr54036-3.cc   | 2 +-
 libstdc++-v3/testsuite/decimal/unary-arith.cc | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libstdc++-v3/testsuite/decimal/binary-arith.cc 
b/libstdc++-v3/testsuite/decimal/binary-arith.cc
index c10a8b6466cb..3eeed7ea9750 100644
--- a/libstdc++-v3/testsuite/decimal/binary-arith.cc
+++ b/libstdc++-v3/testsuite/decimal/binary-arith.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.8  Binary arithmetic operators.
 
diff --git a/libstdc++-v3/testsuite/decimal/comparison.cc 
b/libstdc++-v3/testsuite/decimal/comparison.cc
index cf34c8d74bad..424dd8bd2665 100644
--- a/libstdc++-v3/testsuite/decimal/comparison.cc
+++ b/libstdc++-v3/testsuite/decimal/comparison.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.9  Comparison operators.
 
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc 
b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
index 817d4bb10b1e..d520af9a68d4 100644
--- a/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.2.6  Compound assignment (decimal32).
 // ISO/IEC TR 24733  3.2.3.6  Compound assignment (decimal64).
diff --git a/libstdc++-v3/testsuite/decimal/compound-assignment.cc 
b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
index 2d3e32585698..5aa87e78a739 100644
--- a/libstdc++-v3/testsuite/decimal/compound-assignment.cc
+++ b/libstdc++-v3/testsuite/decimal/compound-assignment.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 
 // ISO/IEC TR 24733  3.2.2.6  Compound assignment (decimal32).
 // ISO/IEC TR 24733  3.2.3.6  Compound assignment (decimal64).
diff --git a/libstdc++-v3/testsuite/decimal/make-decimal.cc 
b/libstdc++-v3/testsuite/decimal/make-decimal.cc
index aa75ac89d479..560196cb305e 100644
--- a/libstdc++-v3/testsuite/decimal/make-decimal.cc
+++ b/libstdc++-v3/testsuite/decimal/make-decimal.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 
-// { dg-require-effective-target dfp }
+// { dg-require-effective-target dfprt }
 // { dg-options "-Wno-pedantic" }
 
 // ISO/IEC TR 24733  3.2.5  Initialization from coefficient and exponent.
diff --git a/libstdc++-v3/testsuite/decimal/pr54036-1.cc 
b/libstdc++-v3/testsuite/decimal/pr54036-1.cc
index 508738701ca0..a07e4c351651 100644
--- a/libstdc++-v3/testsuite/decimal/pr54036-1.cc
+++ b/libstdc++-v3/testsuite/decimal/pr54036-1.cc
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // .
 

[gcc(refs/users/aoliva/heads/testme)] [libstdc++] [testsuite] xfail 128bit from_chars on all aarch64-*-*

2024-07-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e7140d9f2a6451f8101e516b95a46261f7494c56

commit e7140d9f2a6451f8101e516b95a46261f7494c56
Author: Alexandre Oliva 
Date:   Thu Jul 11 09:03:27 2024 -0300

[libstdc++] [testsuite] xfail 128bit from_chars on all aarch64-*-*

Having observed failures of these two tests on yet another aarch64
operating system, and having concluded that the conditions that
trigger the problem ought to be present on all aarch64 targets, I'm
now matching any aarch64 target_os to enable the workaround.


for  libstdc++-v3/ChangeLog

* testsuite/20_util/from_chars/8.cc: Define SKIP_LONG_DOUBLE
on all aarch64-*-* targets.
* testsuite/20_util/to_chars/float128_c++23.cc: Xfail on all
aarch64-*-* targets.

Diff:
---
 libstdc++-v3/testsuite/20_util/from_chars/8.cc| 2 +-
 libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/20_util/from_chars/8.cc 
b/libstdc++-v3/testsuite/20_util/from_chars/8.cc
index bacad89943b5..e92b64349025 100644
--- a/libstdc++-v3/testsuite/20_util/from_chars/8.cc
+++ b/libstdc++-v3/testsuite/20_util/from_chars/8.cc
@@ -17,7 +17,7 @@
 
 // { dg-do run { target c++23 } }
 // { dg-add-options ieee }
-// { dg-additional-options "-DSKIP_LONG_DOUBLE" { target aarch64-*-vxworks* 
aarch64-*-rtems* } }
+// { dg-additional-options "-DSKIP_LONG_DOUBLE" { target aarch64-*-* } }
 
 #include 
 #include 
diff --git a/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc 
b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc
index 6cb9cadcd204..840131c1e569 100644
--- a/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc
+++ b/libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc
@@ -19,7 +19,7 @@
 // { dg-require-effective-target ieee_floats }
 // { dg-require-effective-target size32plus }
 // { dg-add-options ieee }
-// { dg-xfail-run-if "from_chars limited to double-precision" { 
aarch64-*-vxworks* aarch64-*-rtems* } }
+// { dg-xfail-run-if "from_chars limited to double-precision" { aarch64-*-* } }
 
 #include 
 #include 


[gcc(refs/users/aoliva/heads/testme)] [i386] adjust flag_omit_frame_pointer in a single function [PR113719]

2024-07-10 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:ef1d9ef17840032c60e9757d92a55fc71ba55353

commit ef1d9ef17840032c60e9757d92a55fc71ba55353
Author: Alexandre Oliva 
Date:   Thu Jul 11 01:16:32 2024 -0300

[i386] adjust flag_omit_frame_pointer in a single function [PR113719]

The first two patches for PR113719 have each regressed
gcc.dg/ipa/iinline-attr.c on a different target.  The reason for this
instability is that there are competing flag_omit_frame_pointer
overriders on x86:

- ix86_recompute_optlev_based_flags computes and sets a
  -f[no-]omit-frame-pointer default depending on
  USE_IX86_FRAME_POINTER and, in 32-bit mode, optimize_size

- ix86_option_override_internal enables flag_omit_frame_pointer for
  -momit-leaf-frame-pointer to take effect

ix86_option_override[_internal] calls
ix86_recompute_optlev_based_flags before setting
flag_omit_frame_pointer.  It is called during global process_options.

But ix86_recompute_optlev_based_flags is also called by
parse_optimize_options, during attribute processing, and at that
point, ix86_option_override is not called, so the final overrider for
global options is not applied to the optimize attributes.  If they
differ, the testcase fails.

In order to fix this, we need to process all overriders of this option
whenever we process any of them.  Since this setting is affected by
optimization options, it makes sense to compute it in
parse_optimize_options, rather than in process_options.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc (ix86_option_override_internal):
Move flag_omit_frame_pointer final overrider...
(ix86_recompute_optlev_based_flags): ... here.

Diff:
---
 gcc/config/i386/i386-options.cc | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 5824c0cb072e..059ef3ae6ad4 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1911,6 +1911,12 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
opts->x_flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
 }
+
+  /* Keep nonleaf frame pointers.  */
+  if (opts->x_flag_omit_frame_pointer)
+opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
+  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
+opts->x_flag_omit_frame_pointer = 1;
 }
 
 /* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
@@ -2590,12 +2596,6 @@ ix86_option_override_internal (bool main_args_p,
 opts->x_target_flags |= MASK_NO_RED_ZONE;
 }
 
-  /* Keep nonleaf frame pointers.  */
-  if (opts->x_flag_omit_frame_pointer)
-opts->x_target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;
-  else if (TARGET_OMIT_LEAF_FRAME_POINTER_P (opts->x_target_flags))
-opts->x_flag_omit_frame_pointer = 1;
-
   /* If we're doing fast math, we don't care about comparison order
  wrt NaNs.  This lets us use a shorter comparison sequence.  */
   if (opts->x_flag_finite_math_only)


[gcc/aoliva/heads/testme] (269 commits) [i386] adjust flag_omit_frame_pointer in a single function

2024-07-10 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 ef1d9ef17840... [i386] adjust flag_omit_frame_pointer in a single function 

It previously pointed to:

 18cdf562ea2a... UI_To_gnu: cope with per-target precision limits

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  18cdf56... UI_To_gnu: cope with per-target precision limits
  f216931... Introduce general caching of sized type
  0a9b788... [dwarf] get_debug_type of TYPE_NAME to compare with qualifi
  0c598db... make_type_from_size: avoid TYPE_DEBUG_TYPE / TREE_TYPE loop
  2e886d9... Map unpacked type to packed deduped type for debug info
  cdfb1ef... make_type_from_size: fix compare for type reuse
  0803a2d... Follow only proper TYPE_DEBUG_TYPE
  d47c7fe... Avoid dropping bits from num/den in fixed-point types


Summary of changes (added commits):
---

  ef1d9ef... [i386] adjust flag_omit_frame_pointer in a single function 
  36e5e40... RISC-V: c implies zca, and conditionally zcf & zcd (*)
  f777ab3... Daily bump. (*)
  3918bea... Vect: Optimize truncation for .SAT_SUB operands (*)
  d8cd852... libstdc++: Make std::basic_format_context non-copyable [PR1 (*)
  9f75895... libstdc++: Minor optimization for std::locale::encoding() (*)
  c5efc6e... libstdc++: Use direct-initialization for std::vector' (*)
  cda469a... libstdc++: ranges::find needs explicit conversion to size_t (*)
  aae535f... i386: Swap compare operands in ustrunc patterns (*)
  f0fb6b6... c++: remove Concepts TS code (*)
  0c27ead... c: ICE with invalid sizeof [PR115642] (*)
  4c70097... c: ICE on invalid with attribute optimize [PR115549] (*)
  4865a92... testsuite: Align testcase with implementation [PR105090] (*)
  04df2a9... RISC-V: Update testsuite to use b (*)
  2a90c41... RISC-V: Add support for B standard extension (*)
  5686d3b... internal-fn: Reuse SUBREG_PROMOTED_VAR_P handling (*)
  fde96e8... c++: array new with value-initialization [PR115645] (*)
  9d20529... recog: Handle some mode-changing hardreg propagations (*)
  e08ebd7... rtl-ssa: Add replace_nondebug_insn [PR115785] (*)
  7d454ca... fixincludes: skip stdio_stdarg_h on darwin (*)
  c829042... c++, contracts: Fix ICE in create_tmp_var [PR113968] (*)
  8326956... fixincludes: add bypass to darwin_objc_runtime_1 (*)
  2d1f68e... PR modula2/115823 Wrong expansion of isnormal optab (*)
  44933fd... middle-end: Fix stalled swapped condition code value [PR115 (*)
  73f... arm: cleanup legacy ARM_PE code (*)
  23c2e6d... [PR115394] Remove streamer_debugging and it's uses. (*)
  80e446e... Match: Support form 2 for the .SAT_TRUNC (*)
  1ae5fc2... testsuite: Tests the pattern folding x/sqrt(x) to sqrt(x) f (*)
  6fce466... testsuite: Allow matching `{_1, { 0,0,0,0 }}` for vect/slp- (*)
  8f8bddb... Remove expanding complex EQ/NE inside a GIMPLE_RETURN [PR11 (*)
  7a345d0... RISC-V: fix zcmp popretz [PR113715] (*)
  0dcfef4... Daily bump. (*)
  5b46f19... Fix test errors after r15-1394 for sizeof(int)==sizeof(long (*)
  7825c07... c: Fix ICE for redeclaration of structs with different alig (*)
  592a746... c: Fix ICE for incorrect code in comptypes_verify [PR115696 (*)
  e611189... rs6000, remove vector set and vector init built-ins. (*)
  5db91b3... rs6000, remove __builtin_vsx_xvcmpeqsp_p built-in (*)
  c5b4bfe... rs6000, extend vec_xxpermdi built-in for __int128 args (*)
  ca4842f... rs6000, remove __builtin_vsx_xvnegdp and __builtin_vsx_xvne (*)
  7121926... rs6000, remove __builtin_vsx_vperm_* built-ins (*)
  52d5698... rs6000, remove the vec_xxsel built-ins, they are duplicates (*)
  807bed0... rs6000, add overloaded vec_sel with int128 arguments (*)
  8d6326e... rs6000, remove duplicated built-ins of vecmergl and vec_mer (*)
  fd9fdb3... rs6000, Remove redundant vector float/double type conversio (*)
  b620845... rs6000, extend the current vec_{un,}signed{e,o} built-ins (*)
  6031e34... rs6000, fix error in unsigned vector float to unsigned int  (*)
  224cc56... rs6000, Remove __builtin_vsx_xvcv{sp{sx,u}ws,dpuxds_uns} (*)
  7ed9a45... rs6000, Remove __builtin_vsx_cmple* builtins (*)
  d17889d... i386: Implement .SAT_TRUNC for unsigned integers (*)
  2d6e6a7... diagnostics: use refs rather than pointers for diagnostic_{ (*)
  959c168... arm: clean up some legacy FPA related cruft. (*)
  5ef0b7d... RISC-V: Fix comment/naming in attribute parsing code (*)
  85fa334... RISC-V: Deduplicate arch subset list processing (*)
  0717d50... RISC-V: testsuite: Properly gate LTO tests (*)
  298a576... i386: Correct AVX10 CPUID emulation (*)
  4f76717... c: Rewrite c_parser_omp_tile_sizes to use c_parser_expr_lis (*)
  8eab506... c++: Implement C++26 CWG2819 - Allow cv void * null pointer (*)
  23ab7f6... Rename __{float,double}_u to __x86_{float,double}_u to avoi (*)
  ecde8d5... RISC-V: Add testcases for unsigned vector .SAT_ADD IMM form (*)
  35b1096... RISC-V: Add testcases for unsigned 

[gcc/aoliva/heads/testbase] (268 commits) RISC-V: c implies zca, and conditionally zcf & zcd

2024-07-10 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 36e5e409190e... RISC-V: c implies zca, and conditionally zcf & zcd

It previously pointed to:

 73ad57c244c2... libstdc++: Fix std::codecvt for e

Diff:

Summary of changes (added commits):
---

  36e5e40... RISC-V: c implies zca, and conditionally zcf & zcd (*)
  f777ab3... Daily bump. (*)
  3918bea... Vect: Optimize truncation for .SAT_SUB operands (*)
  d8cd852... libstdc++: Make std::basic_format_context non-copyable [PR1 (*)
  9f75895... libstdc++: Minor optimization for std::locale::encoding() (*)
  c5efc6e... libstdc++: Use direct-initialization for std::vector' (*)
  cda469a... libstdc++: ranges::find needs explicit conversion to size_t (*)
  aae535f... i386: Swap compare operands in ustrunc patterns (*)
  f0fb6b6... c++: remove Concepts TS code (*)
  0c27ead... c: ICE with invalid sizeof [PR115642] (*)
  4c70097... c: ICE on invalid with attribute optimize [PR115549] (*)
  4865a92... testsuite: Align testcase with implementation [PR105090] (*)
  04df2a9... RISC-V: Update testsuite to use b (*)
  2a90c41... RISC-V: Add support for B standard extension (*)
  5686d3b... internal-fn: Reuse SUBREG_PROMOTED_VAR_P handling (*)
  fde96e8... c++: array new with value-initialization [PR115645] (*)
  9d20529... recog: Handle some mode-changing hardreg propagations (*)
  e08ebd7... rtl-ssa: Add replace_nondebug_insn [PR115785] (*)
  7d454ca... fixincludes: skip stdio_stdarg_h on darwin (*)
  c829042... c++, contracts: Fix ICE in create_tmp_var [PR113968] (*)
  8326956... fixincludes: add bypass to darwin_objc_runtime_1 (*)
  2d1f68e... PR modula2/115823 Wrong expansion of isnormal optab (*)
  44933fd... middle-end: Fix stalled swapped condition code value [PR115 (*)
  73f... arm: cleanup legacy ARM_PE code (*)
  23c2e6d... [PR115394] Remove streamer_debugging and it's uses. (*)
  80e446e... Match: Support form 2 for the .SAT_TRUNC (*)
  1ae5fc2... testsuite: Tests the pattern folding x/sqrt(x) to sqrt(x) f (*)
  6fce466... testsuite: Allow matching `{_1, { 0,0,0,0 }}` for vect/slp- (*)
  8f8bddb... Remove expanding complex EQ/NE inside a GIMPLE_RETURN [PR11 (*)
  7a345d0... RISC-V: fix zcmp popretz [PR113715] (*)
  0dcfef4... Daily bump. (*)
  5b46f19... Fix test errors after r15-1394 for sizeof(int)==sizeof(long (*)
  7825c07... c: Fix ICE for redeclaration of structs with different alig (*)
  592a746... c: Fix ICE for incorrect code in comptypes_verify [PR115696 (*)
  e611189... rs6000, remove vector set and vector init built-ins. (*)
  5db91b3... rs6000, remove __builtin_vsx_xvcmpeqsp_p built-in (*)
  c5b4bfe... rs6000, extend vec_xxpermdi built-in for __int128 args (*)
  ca4842f... rs6000, remove __builtin_vsx_xvnegdp and __builtin_vsx_xvne (*)
  7121926... rs6000, remove __builtin_vsx_vperm_* built-ins (*)
  52d5698... rs6000, remove the vec_xxsel built-ins, they are duplicates (*)
  807bed0... rs6000, add overloaded vec_sel with int128 arguments (*)
  8d6326e... rs6000, remove duplicated built-ins of vecmergl and vec_mer (*)
  fd9fdb3... rs6000, Remove redundant vector float/double type conversio (*)
  b620845... rs6000, extend the current vec_{un,}signed{e,o} built-ins (*)
  6031e34... rs6000, fix error in unsigned vector float to unsigned int  (*)
  224cc56... rs6000, Remove __builtin_vsx_xvcv{sp{sx,u}ws,dpuxds_uns} (*)
  7ed9a45... rs6000, Remove __builtin_vsx_cmple* builtins (*)
  d17889d... i386: Implement .SAT_TRUNC for unsigned integers (*)
  2d6e6a7... diagnostics: use refs rather than pointers for diagnostic_{ (*)
  959c168... arm: clean up some legacy FPA related cruft. (*)
  5ef0b7d... RISC-V: Fix comment/naming in attribute parsing code (*)
  85fa334... RISC-V: Deduplicate arch subset list processing (*)
  0717d50... RISC-V: testsuite: Properly gate LTO tests (*)
  298a576... i386: Correct AVX10 CPUID emulation (*)
  4f76717... c: Rewrite c_parser_omp_tile_sizes to use c_parser_expr_lis (*)
  8eab506... c++: Implement C++26 CWG2819 - Allow cv void * null pointer (*)
  23ab7f6... Rename __{float,double}_u to __x86_{float,double}_u to avoi (*)
  ecde8d5... RISC-V: Add testcases for unsigned vector .SAT_ADD IMM form (*)
  35b1096... RISC-V: Add testcases for unsigned vector .SAT_ADD IMM form (*)
  ceb944a... Daily bump. (*)
  98914f9... [to-be-committed][RISC-V][V3] DCE analysis for extension el (*)
  113b5ce... c-format.cc: add ctors to format_check_results and format_c (*)
  2b3027b... i386: Promote {QI,HI}mode x86_movcc_0_m1_neg to SImod (*)
  40d234d... libstdc++: Fix _Atomic(T) macro in  [PR115807] (*)
  a0e64a0... Remove trailing whitespace from invoke.texi (*)
  f3f9e4e... x86: Support bitwise and/andnot/abs/neg/copysign/xorsign op (*)
  5be9703... rs6000: load high and low part of 128bit vector independent (*)
  dafd63d... RISC-V: Implement .SAT_TRUNC for vector unsigned int (*)
  7183a8c... fortran: Move definition of variable closer to its uses (*)
  682731d... [RISC-V] add implied 

[gcc r15-1816] Deduplicate explicitly-sized types

2024-07-03 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:640f0f3e2b771e23665924f24527e6b1a5db8d3c

commit r15-1816-g640f0f3e2b771e23665924f24527e6b1a5db8d3c
Author: Alexandre Oliva 
Date:   Wed Jul 3 07:33:08 2024 -0300

Deduplicate explicitly-sized types

When make_type_from_size is called with a biased type, for an entity
that isn't explicitly biased, we may refrain from reusing the given
type because it doesn't seem to match, and then proceed to create an
exact copy of that type.

Compute earlier the biased status of the expected type, early enough
for the suitability check of the given type.  Modify for_biased
instead of biased_p, so that biased_p remains with the given type's
status for the comparison.

Avoid creating unnecessary copies of types in make_type_from_size, by
caching and reusing previously-created identical types, similarly to
the caching of packable types.

While at that, fix two vaguely related issues:

- TYPE_DEBUG_TYPE's storage is shared with other sorts of references
to types, so it shouldn't be accessed unless
TYPE_CAN_HAVE_DEBUG_TYPE_P holds.

- When we choose the narrower/packed variant of a type as the main
debug info type, we fail to output its name if we fail to follow debug
type for the TYPE_NAME decl type in modified_type_die.


for  gcc/ada/ChangeLog

* gcc-interface/misc.cc (gnat_get_array_descr_info): Only follow
TYPE_DEBUG_TYPE if TYPE_CAN_HAVE_DEBUG_TYPE_P.
* gcc-interface/utils.cc (sized_type_hash): New struct.
(sized_type_hasher): New struct.
(sized_type_hash_table): New variable.
(init_gnat_utils): Allocate it.
(destroy_gnat_utils): Release it.
(sized_type_hasher::equal): New.
(hash_sized_type): New.
(canonicalize_sized_type): New.
(make_type_from_size): Use it to cache packed variants.  Fix
type reuse by combining biased_p and for_biased earlier.  Hold
the combination in for_biased, adjusting later uses.

for  gcc/ChangeLog

* dwarf2out.cc (modified_type_die): Follow name's debug type.

for  gcc/testsuite/ChangeLog

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/misc.cc   |   3 +-
 gcc/ada/gcc-interface/utils.cc  | 116 ++--
 gcc/dwarf2out.cc|   7 ++-
 gcc/testsuite/gnat.dg/bias1.adb |   3 +-
 4 files changed, 120 insertions(+), 9 deletions(-)

diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index 4f6f6774fe7..f77629ce70b 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -967,7 +967,8 @@ gnat_get_array_descr_info (const_tree const_type,
 
   while (true)
{
- if (TYPE_DEBUG_TYPE (source_element_type))
+ if (TYPE_CAN_HAVE_DEBUG_TYPE_P (source_element_type)
+ && TYPE_DEBUG_TYPE (source_element_type))
source_element_type = TYPE_DEBUG_TYPE (source_element_type);
  else if (TYPE_IS_PADDING_P (source_element_type))
source_element_type
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 0eb9af8d4a2..66e3192ea4f 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -364,6 +364,26 @@ struct pad_type_hasher : ggc_cache_ptr_hash
 
 static GTY ((cache)) hash_table *pad_type_hash_table;
 
+struct GTY((for_user)) sized_type_hash
+{
+  hashval_t hash;
+  tree type;
+};
+
+struct sized_type_hasher : ggc_cache_ptr_hash
+{
+  static inline hashval_t hash (sized_type_hash *t) { return t->hash; }
+  static bool equal (sized_type_hash *a, sized_type_hash *b);
+
+  static int
+  keep_cache_entry (sized_type_hash *)
+  {
+return ggc_marked_p (t->type);
+  }
+};
+
+static GTY ((cache)) hash_table *sized_type_hash_table;
+
 static tree merge_sizes (tree, tree, tree, bool, bool);
 static tree fold_bit_position (const_tree);
 static tree compute_related_constant (tree, tree);
@@ -421,6 +441,9 @@ init_gnat_utils (void)
 
   /* Initialize the hash table of padded types.  */
   pad_type_hash_table = hash_table::create_ggc (512);
+
+  /* Initialize the hash table of sized types.  */
+  sized_type_hash_table = hash_table::create_ggc (512);
 }
 
 /* Destroy data structures of the utils.cc module.  */
@@ -443,6 +466,10 @@ destroy_gnat_utils (void)
   /* Destroy the hash table of padded types.  */
   pad_type_hash_table->empty ();
   pad_type_hash_table = NULL;
+
+  /* Destroy the hash table of sized types.  */
+  sized_type_hash_table->empty ();
+  sized_type_hash_table = NULL;
 }
 
 /* GNAT_ENTITY is a GNAT tree node for an entity.  Associate GNU_DECL, a GCC
@@ -1350,6 +1377,79 @@ type_unsigned_for_rm (tree type)
   return false;
 }
 
+/* Return true iff the sized types are equivalent.  */
+
+bool
+sized_type_hasher::equal 

[gcc r15-1815] [debug] Avoid dropping bits from num/den in fixed-point types

2024-07-03 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:113c4826f5e1ff88a9e1625980ff0b617583279c

commit r15-1815-g113c4826f5e1ff88a9e1625980ff0b617583279c
Author: Alexandre Oliva 
Date:   Wed Jul 3 07:33:00 2024 -0300

[debug] Avoid dropping bits from num/den in fixed-point types

We used to use an unsigned 128-bit type to hold the numerator and
denominator used to represent the delta of a fixed-point type in debug
information, but there are cases in which that was not enough, and
more significant bits silently overflowed and got omitted from debug
information.

Introduce a mode in which UI_to_gnu selects a wide-enough unsigned
type, and use that to convert numerator and denominator.  While at
that, avoid exceeding the maximum precision for wide ints, and for
available int modes, when selecting a type to represent very wide
constants, falling back to 0/0 for unrepresentable fractions.


for  gcc/ada/ChangeLog

* gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
wide enough unsigned type.  Fail if the constant exceeds the
representable numbers.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
numerator and denominator of fixed-point types.  In case of
failure, fall back to an indeterminate fraction.

Diff:
---
 gcc/ada/gcc-interface/cuintp.cc | 66 ++---
 gcc/ada/gcc-interface/decl.cc   | 19 +---
 2 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/gcc/ada/gcc-interface/cuintp.cc b/gcc/ada/gcc-interface/cuintp.cc
index cdf6c019750..1903c5af0f1 100644
--- a/gcc/ada/gcc-interface/cuintp.cc
+++ b/gcc/ada/gcc-interface/cuintp.cc
@@ -35,6 +35,7 @@
 #include "tree.h"
 #include "inchash.h"
 #include "fold-const.h"
+#include "stor-layout.h"
 
 #include "ada.h"
 #include "types.h"
@@ -67,7 +68,9 @@ build_cst_from_int (tree type, HOST_WIDE_INT low)
 /* Similar to UI_To_Int, but return a GCC INTEGER_CST or REAL_CST node,
depending on whether TYPE is an integral or real type.  Overflow is tested
by the constant-folding used to build the node.  TYPE is the GCC type of
-   the resulting node.  */
+   the resulting node.  If TYPE is NULL, an unsigned integer type wide enough
+   to hold the entire constant is selected, and if no such type exists,
+   return NULL_TREE.  */
 
 tree
 UI_To_gnu (Uint Input, tree type)
@@ -77,8 +80,10 @@ UI_To_gnu (Uint Input, tree type)
  any such possible value for intermediate computations and then rely on a
  conversion back to TYPE to perform the bias adjustment when need be.  */
   tree comp_type
-= TREE_CODE (type) == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type)
-  ? get_base_type (type) : type;
+= (!type ? gnat_type_for_size (32, 1)
+   : (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_BIASED_REPRESENTATION_P (type))
+   ? get_base_type (type) : type);
   tree gnu_ret;
 
   if (Input <= Uint_Direct_Last)
@@ -88,9 +93,14 @@ UI_To_gnu (Uint Input, tree type)
   Int Idx = (*Uints_Ptr)[Input - Uint_Table_Start].Loc;
   Pos Length = (*Uints_Ptr)[Input - Uint_Table_Start].Length;
   Int First = (*Udigits_Ptr)[Idx];
+  tree_code code = First < 0 ? MINUS_EXPR : PLUS_EXPR;
   tree gnu_base;
 
   gcc_assert (Length > 0);
+  /* The extension of unsigned types we use to try to fit the
+constant only works if we're dealing with nonnegative
+constants, but that's what we expect when !TYPE.  */
+  gcc_assert (type || First >= 0);
 
   /* The computations we perform below always require a type at least as
 large as an integer not to overflow.  FP types are always fine, but
@@ -103,22 +113,44 @@ UI_To_gnu (Uint Input, tree type)
   gnu_base = build_cst_from_int (comp_type, Base);
 
   gnu_ret = build_cst_from_int (comp_type, First);
-  if (First < 0)
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (MINUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
-  else
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (PLUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
+  for (Idx++, Length--; Length; Idx++, Length--)
+   for (;;)
+ {
+   tree elt, scaled, next_ret;
+   elt = build_cst_from_int (comp_type, (*Udigits_Ptr)[Idx]);
+   /* We want to detect overflows with an unsigned type when
+  TYPE is not 

[gcc r15-1814] [i386] restore recompute to override opts after change [PR113719]

2024-07-03 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:bf2fc0a27b35de039c3d45e6d7ea9ad0a8a305ba

commit r15-1814-gbf2fc0a27b35de039c3d45e6d7ea9ad0a8a305ba
Author: Alexandre Oliva 
Date:   Thu Jun 13 00:12:47 2024 -0300

[i386] restore recompute to override opts after change [PR113719]

The first patch for PR113719 regressed gcc.dg/ipa/iinline-attr.c on
toolchains configured to --enable-frame-pointer, because the
optimization node created within handle_optimize_attribute had
flag_omit_frame_pointer incorrectly set, whereas
default_optimization_node didn't.  With this difference,
can_inline_edge_by_limits_p flagged an optimization mismatch and we
refused to inline the function that had a redundant optimization flag
into one that didn't, which is exactly what is tested for there.

This patch restores the calls to ix86_default_align and
ix86_recompute_optlev_based_flags that used to be, and ought to be,
issued during TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE, but preserves the
intent of the original change, of having those functions called at
different spots within ix86_option_override_internal.  To that end,
the remaining bits were refactored into a separate function, that was
in turn adjusted to operate on explicitly-passed opts and opts_set,
rather than going for their global counterparts.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc
(ix86_override_options_after_change_1): Add opts and opts_set
parms, operate on them, after factoring out of...
(ix86_override_options_after_change): ... this.  Restore calls
of ix86_default_align and ix86_recompute_optlev_based_flags.
(ix86_option_override_internal): Call the factored-out bits.

Diff:
---
 gcc/config/i386/i386-options.cc | 59 -
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 1ef2c71a7a2..5824c0cb072 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1913,37 +1913,58 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
 }
 }
 
-/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+/* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
 
-void
-ix86_override_options_after_change (void)
+static void
+ix86_override_options_after_change_1 (struct gcc_options *opts,
+ struct gcc_options *opts_set)
 {
+#define OPTS_SET_P(OPTION) opts_set->x_ ## OPTION
+#define OPTS(OPTION) opts->x_ ## OPTION
+
   /* Disable unrolling small loops when there's explicit
  -f{,no}unroll-loop.  */
-  if ((OPTION_SET_P (flag_unroll_loops))
- || (OPTION_SET_P (flag_unroll_all_loops)
-&& flag_unroll_all_loops))
+  if ((OPTS_SET_P (flag_unroll_loops))
+ || (OPTS_SET_P (flag_unroll_all_loops)
+&& OPTS (flag_unroll_all_loops)))
 {
-  if (!OPTION_SET_P (ix86_unroll_only_small_loops))
-   ix86_unroll_only_small_loops = 0;
+  if (!OPTS_SET_P (ix86_unroll_only_small_loops))
+   OPTS (ix86_unroll_only_small_loops) = 0;
   /* Re-enable -frename-registers and -fweb if funroll-loops
 enabled.  */
-  if (!OPTION_SET_P (flag_web))
-   flag_web = flag_unroll_loops;
-  if (!OPTION_SET_P (flag_rename_registers))
-   flag_rename_registers = flag_unroll_loops;
+  if (!OPTS_SET_P (flag_web))
+   OPTS (flag_web) = OPTS (flag_unroll_loops);
+  if (!OPTS_SET_P (flag_rename_registers))
+   OPTS (flag_rename_registers) = OPTS (flag_unroll_loops);
   /* -fcunroll-grow-size default follws -f[no]-unroll-loops.  */
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_unroll_loops
-|| flag_peel_loops
-|| optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_unroll_loops)
+|| OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
   else
 {
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
 
+#undef OPTS
+#undef OPTS_SET_P
+}
+
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+
+void
+ix86_override_options_after_change (void)
+{
+  ix86_default_align (_options);
+
+  ix86_recompute_optlev_based_flags (_options, _options_set);
+
+  ix86_override_options_after_change_1 (_options, _options_set);
 }
 
 /* Clear stack slot assignments remembered from previous functions.
@@ -2493,7 +2514,7 @@ ix86_option_override_internal (bool main_args_p,
 
   ix86_recompute_optlev_based_flags (opts, opts_set);
 

[gcc(refs/users/aoliva/heads/testme)] UI_To_gnu: cope with per-target precision limits

2024-07-01 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:18cdf562ea2ae6b43df502e5ebb043f40d531884

commit 18cdf562ea2ae6b43df502e5ebb043f40d531884
Author: Alexandre Oliva 
Date:   Mon Jul 1 22:17:45 2024 -0300

UI_To_gnu: cope with per-target precision limits

Avoid exceeding the maximum precision for wide ints, and for available
int modes, when selecting a type to represent very wide constants,
falling back to 0/0 for unrepresentable fractions.


for  gcc/ada/ChangeLog

* gcc-interface/cuintp.cc (UI_To_gnu): Don't exceed available
integral mode widths.  Fail if the constant exceeds the
representable numbers.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Recognize the
failure mode and fall back to an indeterminate fraction.

Diff:
---
 gcc/ada/gcc-interface/cuintp.cc | 40 
 gcc/ada/gcc-interface/decl.cc   |  4 
 2 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/gcc/ada/gcc-interface/cuintp.cc b/gcc/ada/gcc-interface/cuintp.cc
index ad345096282..6a03131144b 100644
--- a/gcc/ada/gcc-interface/cuintp.cc
+++ b/gcc/ada/gcc-interface/cuintp.cc
@@ -69,7 +69,8 @@ build_cst_from_int (tree type, HOST_WIDE_INT low)
depending on whether TYPE is an integral or real type.  Overflow is tested
by the constant-folding used to build the node.  TYPE is the GCC type of
the resulting node.  If TYPE is NULL, an unsigned integer type wide enough
-   to hold the entire constant is selected.  */
+   to hold the entire constant is selected, and if no such type exists,
+   return NULL_TREE.  */
 
 tree
 UI_To_gnu (Uint Input, tree type)
@@ -79,7 +80,7 @@ UI_To_gnu (Uint Input, tree type)
  any such possible value for intermediate computations and then rely on a
  conversion back to TYPE to perform the bias adjustment when need be.  */
   tree comp_type
-= (!type ? gnat_type_for_size (32, 0)
+= (!type ? gnat_type_for_size (32, 1)
: (TREE_CODE (type) == INTEGER_TYPE
  && TYPE_BIASED_REPRESENTATION_P (type))
? get_base_type (type) : type);
@@ -96,6 +97,10 @@ UI_To_gnu (Uint Input, tree type)
   tree gnu_base;
 
   gcc_assert (Length > 0);
+  /* The extension of unsigned types we use to try to fit the
+constant only works if we're dealing with nonnegative
+constants, but that's what we expect when !TYPE.  */
+  gcc_assert (type || First >= 0);
 
   /* The computations we perform below always require a type at least as
 large as an integer not to overflow.  FP types are always fine, but
@@ -104,9 +109,6 @@ UI_To_gnu (Uint Input, tree type)
 convert the final result back to the incoming type later on.  */
   if (!SCALAR_FLOAT_TYPE_P (comp_type) && TYPE_PRECISION (comp_type) < 32)
comp_type = gnat_type_for_size (32, 0);
-  else if (!type && TYPE_UNSIGNED (comp_type))
-   /* Choose a signed type, so that we can detect overflow.  */
-   comp_type = make_signed_type (TYPE_PRECISION (comp_type));
 
   gnu_base = build_cst_from_int (comp_type, Base);
 
@@ -114,24 +116,38 @@ UI_To_gnu (Uint Input, tree type)
   for (Idx++, Length--; Length; Idx++, Length--)
for (;;)
  {
-   tree next_ret = fold_build2 (code, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int
-(comp_type, (*Udigits_Ptr)[Idx]));
+   tree elt, scaled, next_ret;
+   elt = build_cst_from_int (comp_type, (*Udigits_Ptr)[Idx]);
+   if (!type)
+ {
+   scaled = int_const_binop (MULT_EXPR, gnu_ret, gnu_base, -1);
+   next_ret = int_const_binop (code, scaled, elt, -1);
+ }
+   else
+ {
+   scaled = fold_build2 (MULT_EXPR, comp_type, gnu_ret, gnu_base);
+   next_ret = fold_build2 (code, comp_type, scaled, elt);
+ }
if (!TREE_OVERFLOW (next_ret) || type)
  {
gnu_ret = next_ret;
break;
  }
-   comp_type = make_signed_type (TYPE_PRECISION (comp_type) * 2);
+   opt_scalar_int_mode wider_mode
+ = GET_MODE_WIDER_MODE (SCALAR_INT_TYPE_MODE
+(comp_type)).require ();
+   if (!wider_mode.exists ())
+ /* Signal that we couldn't represent the value.  */
+ return NULL_TREE;
+   comp_type = make_unsigned_type (GET_MODE_BITSIZE
+   (wider_mode.require ()));
gnu_base = convert (comp_type, gnu_base);
gnu_ret = convert (comp_type, gnu_ret);
  }
 }
 
   if (!type)
-type = make_unsigned_type (TYPE_PRECISION (comp_type));
+type = comp_type;
   gnu_ret = 

[gcc(refs/users/aoliva/heads/testme)] Introduce general caching of sized type

2024-07-01 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:f216931275ed5b4244964ede0739e8c7e3cdd624

commit f216931275ed5b4244964ede0739e8c7e3cdd624
Author: Alexandre Oliva 
Date:   Mon Jul 1 22:17:10 2024 -0300

Introduce general caching of sized type

The simplified form of caching, in TYPE_DEBUG_TYPE, didn't work on
big-endian targets, so introduce general caching for sized integral
types, modeled after caching of packable types.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (sized_type_hash): New struct.
(sized_type_hasher): New struct.
(sized_type_hash_table): New variable.
(init_gnat_utils): Allocate it.
(destroy_gnat_utils): Release it.
(sized_type_hasher::equal): New.
(hash_sized_type): New.
(canonicalize_sized_type): New.
(make_type_from_size): Use it, instead of
TYPE_DEBUG_TYPE-based caching.

Diff:
---
 gcc/ada/gcc-interface/utils.cc | 124 ++---
 1 file changed, 103 insertions(+), 21 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index b46e035e1d4..66e3192ea4f 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -364,6 +364,26 @@ struct pad_type_hasher : ggc_cache_ptr_hash
 
 static GTY ((cache)) hash_table *pad_type_hash_table;
 
+struct GTY((for_user)) sized_type_hash
+{
+  hashval_t hash;
+  tree type;
+};
+
+struct sized_type_hasher : ggc_cache_ptr_hash
+{
+  static inline hashval_t hash (sized_type_hash *t) { return t->hash; }
+  static bool equal (sized_type_hash *a, sized_type_hash *b);
+
+  static int
+  keep_cache_entry (sized_type_hash *)
+  {
+return ggc_marked_p (t->type);
+  }
+};
+
+static GTY ((cache)) hash_table *sized_type_hash_table;
+
 static tree merge_sizes (tree, tree, tree, bool, bool);
 static tree fold_bit_position (const_tree);
 static tree compute_related_constant (tree, tree);
@@ -421,6 +441,9 @@ init_gnat_utils (void)
 
   /* Initialize the hash table of padded types.  */
   pad_type_hash_table = hash_table::create_ggc (512);
+
+  /* Initialize the hash table of sized types.  */
+  sized_type_hash_table = hash_table::create_ggc (512);
 }
 
 /* Destroy data structures of the utils.cc module.  */
@@ -443,6 +466,10 @@ destroy_gnat_utils (void)
   /* Destroy the hash table of padded types.  */
   pad_type_hash_table->empty ();
   pad_type_hash_table = NULL;
+
+  /* Destroy the hash table of sized types.  */
+  sized_type_hash_table->empty ();
+  sized_type_hash_table = NULL;
 }
 
 /* GNAT_ENTITY is a GNAT tree node for an entity.  Associate GNU_DECL, a GCC
@@ -1350,6 +1377,79 @@ type_unsigned_for_rm (tree type)
   return false;
 }
 
+/* Return true iff the sized types are equivalent.  */
+
+bool
+sized_type_hasher::equal (sized_type_hash *t1, sized_type_hash *t2)
+{
+  tree type1, type2;
+
+  if (t1->hash != t2->hash)
+return false;
+
+  type1 = t1->type;
+  type2 = t2->type;
+
+  /* We consider sized types equivalent if they have the same name,
+ size, alignment, RM size, and biasing.  The range is not expected
+ to vary across different-sized versions of the same base
+ type.  */
+  bool res
+= (TYPE_NAME (type1) == TYPE_NAME (type2)
+   && TYPE_SIZE (type1) == TYPE_SIZE (type2)
+   && TYPE_ALIGN (type1) == TYPE_ALIGN (type2)
+   && TYPE_RM_SIZE (type1) == TYPE_RM_SIZE (type2)
+   && (TYPE_BIASED_REPRESENTATION_P (type1)
+  == TYPE_BIASED_REPRESENTATION_P (type2)));
+
+  gcc_assert (!res
+ || (TYPE_RM_MIN_VALUE (type1) == TYPE_RM_MIN_VALUE (type2)
+ && TYPE_RM_MAX_VALUE (type1) == TYPE_RM_MAX_VALUE (type2)));
+
+  return res;
+}
+
+/* Compute the hash value for the sized TYPE.  */
+
+static hashval_t
+hash_sized_type (tree type)
+{
+  hashval_t hashcode;
+
+  hashcode = iterative_hash_expr (TYPE_NAME (type), 0);
+  hashcode = iterative_hash_expr (TYPE_SIZE (type), hashcode);
+  hashcode = iterative_hash_hashval_t (TYPE_ALIGN (type), hashcode);
+  hashcode = iterative_hash_expr (TYPE_RM_SIZE (type), hashcode);
+  hashcode
+= iterative_hash_hashval_t (TYPE_BIASED_REPRESENTATION_P (type), hashcode);
+
+  return hashcode;
+}
+
+/* Look up the sized TYPE in the hash table and return its canonical version
+   if it exists; otherwise, insert it into the hash table.  */
+
+static tree
+canonicalize_sized_type (tree type)
+{
+  const hashval_t hashcode = hash_sized_type (type);
+  struct sized_type_hash in, *h, **slot;
+
+  in.hash = hashcode;
+  in.type = type;
+  slot = sized_type_hash_table->find_slot_with_hash (, hashcode, INSERT);
+  h = *slot;
+  if (!h)
+{
+  h = ggc_alloc ();
+  h->hash = hashcode;
+  h->type = type;
+  *slot = h;
+}
+
+  return h->type;
+}
+
 /* Given a type TYPE, return a new type whose size is appropriate for SIZE.
If TYPE is the best type, return it.  Otherwise, make a new type.  We
only support new integral 

[gcc(refs/users/aoliva/heads/testme)] [dwarf] get_debug_type of TYPE_NAME to compare with qualified_type

2024-07-01 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0a9b788f27514fe72c539de8a58f6d6cb6e2e97f

commit 0a9b788f27514fe72c539de8a58f6d6cb6e2e97f
Author: Alexandre Oliva 
Date:   Fri Jun 28 08:13:52 2024 -0300

[dwarf] get_debug_type of TYPE_NAME to compare with qualified_type

When we choose the narrower/packed variant of a type as the main debug
info type, we fail to output its name if we fail to follow
debug type for the TYPE_NAME decl type in modified_type_die.


for  gcc/ChangeLog

* dwarf2out.cc (modified_type_die): Follow name's debug type.

Diff:
---
 gcc/dwarf2out.cc | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index f463435e446..5ce1a3e6f66 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -14051,8 +14051,11 @@ modified_type_die (tree type, int cv_quals, bool 
reverse,
   && (qualified_type == TYPE_MAIN_VARIANT (type)
   || (cv_quals == TYPE_UNQUALIFIED)))
  || (TREE_CODE (name) == TYPE_DECL
- && TREE_TYPE (name) == qualified_type
- && DECL_NAME (name
+ && DECL_NAME (name)
+ && (TREE_TYPE (name) == qualified_type
+ || (lang_hooks.types.get_debug_type
+ && (lang_hooks.types.get_debug_type (TREE_TYPE (name))
+ == qualified_type))
 {
   if (TREE_CODE (name) == TYPE_DECL)
/* Could just call add_name_and_src_coords_attributes here,


[gcc/aoliva/heads/testme] (3 commits) UI_To_gnu: cope with per-target precision limits

2024-07-01 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 18cdf562ea2... UI_To_gnu: cope with per-target precision limits

It previously pointed to:

 03263dba590... [dwarf] get_debug_type of qualified_type

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  03263db... [dwarf] get_debug_type of qualified_type


Summary of changes (added commits):
---

  18cdf56... UI_To_gnu: cope with per-target precision limits
  f216931... Introduce general caching of sized type
  0a9b788... [dwarf] get_debug_type of TYPE_NAME to compare with qualifi


[gcc(refs/users/aoliva/heads/testme)] [dwarf] get_debug_type of qualified_type

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:03263dba5906e4f7987c89cff3c8e3f4c804e8df

commit 03263dba5906e4f7987c89cff3c8e3f4c804e8df
Author: Alexandre Oliva 
Date:   Fri Jun 28 08:13:52 2024 -0300

[dwarf] get_debug_type of qualified_type

When we choose the narrower/packed variant of a type as the main debug
info type, we fail to output its name if we fail to follow
debug type for the TYPE_NAME decl type in modified_type_die.


for  gcc/ChangeLog

* dwarf2out.cc (modified_type_die): Follow name's debug type.

Diff:
---
 gcc/dwarf2out.cc | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index f463435e446..5ce1a3e6f66 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -14051,8 +14051,11 @@ modified_type_die (tree type, int cv_quals, bool 
reverse,
   && (qualified_type == TYPE_MAIN_VARIANT (type)
   || (cv_quals == TYPE_UNQUALIFIED)))
  || (TREE_CODE (name) == TYPE_DECL
- && TREE_TYPE (name) == qualified_type
- && DECL_NAME (name
+ && DECL_NAME (name)
+ && (TREE_TYPE (name) == qualified_type
+ || (lang_hooks.types.get_debug_type
+ && (lang_hooks.types.get_debug_type (TREE_TYPE (name))
+ == qualified_type))
 {
   if (TREE_CODE (name) == TYPE_DECL)
/* Could just call add_name_and_src_coords_attributes here,


[gcc/aoliva/heads/testme] [dwarf] get_debug_type of qualified_type

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 03263dba590... [dwarf] get_debug_type of qualified_type

It previously pointed to:

 0aa14458da7... [dwarf] get_debug_type of qualified_type

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  0aa1445... [dwarf] get_debug_type of qualified_type


Summary of changes (added commits):
---

  03263db... [dwarf] get_debug_type of qualified_type


[gcc(refs/users/aoliva/heads/testme)] [dwarf] get_debug_type of qualified_type

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0aa14458da76fdbb55e77b0ed5b8069fe57ed56d

commit 0aa14458da76fdbb55e77b0ed5b8069fe57ed56d
Author: Alexandre Oliva 
Date:   Fri Jun 28 08:13:52 2024 -0300

[dwarf] get_debug_type of qualified_type

When we choose the narrower/packed variant of a type as the main debug
info type, we fail to output its name if we fail to advance
qualified_type to the main debug type in modified_type_die.


for  gcc/ChangeLog

* dwarf2out.cc (modified_type_die): Take qualified_type's
debug type.

Diff:
---
 gcc/dwarf2out.cc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index f463435e446..bf5faffb700 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -13758,6 +13758,13 @@ modified_type_die (tree type, int cv_quals, bool 
reverse,
   /* If we do, then we can just use its DIE, if it exists.  */
   if (qualified_type)
 {
+  if (lang_hooks.types.get_debug_type)
+   {
+ tree debug_type = lang_hooks.types.get_debug_type (qualified_type);
+ if (debug_type != NULL)
+   qualified_type = debug_type;
+   }
+
   mod_type_die = lookup_type_die (qualified_type);
 
   /* DW_AT_endianity doesn't come from a qualifier on the type, so it is


[gcc(refs/users/aoliva/heads/testme)] make_type_from_size: avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0c598db8978a3569bd250a67ac52b7a88d544041

commit 0c598db8978a3569bd250a67ac52b7a88d544041
Author: Alexandre Oliva 
Date:   Fri Jun 28 05:35:58 2024 -0300

make_type_from_size: avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

Before make_type_from_size links a preexisting type to the
newly-created narrower type to use the latter for debug information
purposes, make sure that won't form a loop: if the type didn't have
TREE_TYPE set, the new type will link back to the original type,
rather than to the type's base type, and then modified_type_die would
recurse indefinitely between them.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (make_type_from_size): Avoid forming
loops.

Diff:
---
 gcc/ada/gcc-interface/utils.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index daf8d7ccdc5..b46e035e1d4 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1427,10 +1427,12 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   /* Enable us to avoid creating the same narrower type multiple
 times, and avoid duplication in debug information, by mapping
 the wider type to the narrower version.  If biasing is
-different, we use the narrower type for debug information.  */
+different, we use the narrower type for debug information.
+Be careful to avoid forming loops.  */
   if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
  && !TYPE_DEBUG_TYPE (type)
- && biased_p == for_biased)
+ && biased_p == for_biased
+ && TREE_TYPE (new_type) != type)
SET_TYPE_DEBUG_TYPE (type, new_type);
 
   return new_type;


[gcc/aoliva/heads/testme] (2 commits) [dwarf] get_debug_type of qualified_type

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 0aa14458da7... [dwarf] get_debug_type of qualified_type

It previously pointed to:

 8f9705aadea... make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  8f9705a... make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops


Summary of changes (added commits):
---

  0aa1445... [dwarf] get_debug_type of qualified_type
  0c598db... make_type_from_size: avoid TYPE_DEBUG_TYPE / TREE_TYPE loop


[gcc(refs/users/aoliva/heads/testme)] Map unpacked type to packed deduped type for debug info

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:2e886d9baca052fdb7957b05697d0bdbf847c251

commit 2e886d9baca052fdb7957b05697d0bdbf847c251
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:27 2024 -0300

Map unpacked type to packed deduped type for debug info

Avoid creating unnecessary copies of types in make_type_from_size.
Cache the packed version of a biased type in TYPE_DEBUG_TYPE, so as to
map the unpacked type to it.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (make_type_from_size): Cache packed
variant, and map unpacked type to it in debug info.

for  gcc/testsuite/ChangeLog

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/utils.cc  | 19 +++
 gcc/testsuite/gnat.dg/bias1.adb |  3 ++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index d8d42f57b89..daf8d7ccdc5 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1399,6 +1399,15 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
  || size > (Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE))
break;
 
+  /* If we've already created this type, the base type is supposed
+to map to it.  Check that it is what we expect.  */
+  if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
+ && (new_type = TYPE_DEBUG_TYPE (type))
+ && TYPE_PRECISION (new_type) == size
+ && ((TREE_CODE (new_type) == INTEGER_TYPE
+  && TYPE_BIASED_REPRESENTATION_P (new_type)) == for_biased))
+   return new_type;
+
   /* The type should be an unsigned type if the original type is unsigned
 or if the lower bound is constant and non-negative or if the type is
 biased, see E_Signed_Integer_Subtype case of gnat_to_gnu_entity.  */
@@ -1414,6 +1423,16 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   TYPE_NAME (new_type) = TYPE_NAME (type);
   TYPE_BIASED_REPRESENTATION_P (new_type) = for_biased;
   SET_TYPE_RM_SIZE (new_type, bitsize_int (size));
+
+  /* Enable us to avoid creating the same narrower type multiple
+times, and avoid duplication in debug information, by mapping
+the wider type to the narrower version.  If biasing is
+different, we use the narrower type for debug information.  */
+  if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
+ && !TYPE_DEBUG_TYPE (type)
+ && biased_p == for_biased)
+   SET_TYPE_DEBUG_TYPE (type, new_type);
+
   return new_type;
 
 case RECORD_TYPE:
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index 016a159b692..d9a00a1aa45 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,6 +1,7 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
+--  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -31,4 +32,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
\ No newline at end of file
+end Bias1;


[gcc(refs/users/aoliva/heads/testme)] make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:8f9705aadea6b840c9a1403a7497dde7bb586ce6

commit 8f9705aadea6b840c9a1403a7497dde7bb586ce6
Author: Alexandre Oliva 
Date:   Fri Jun 28 05:35:58 2024 -0300

make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

Diff:
---
 gcc/ada/gcc-interface/utils.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index daf8d7ccdc5..b46e035e1d4 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1427,10 +1427,12 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   /* Enable us to avoid creating the same narrower type multiple
 times, and avoid duplication in debug information, by mapping
 the wider type to the narrower version.  If biasing is
-different, we use the narrower type for debug information.  */
+different, we use the narrower type for debug information.
+Be careful to avoid forming loops.  */
   if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
  && !TYPE_DEBUG_TYPE (type)
- && biased_p == for_biased)
+ && biased_p == for_biased
+ && TREE_TYPE (new_type) != type)
SET_TYPE_DEBUG_TYPE (type, new_type);
 
   return new_type;


[gcc(refs/users/aoliva/heads/testme)] make_type_from_size: fix compare for type reuse

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:cdfb1ef5b6c21a89bc518a170d359169f1e28fde

commit cdfb1ef5b6c21a89bc518a170d359169f1e28fde
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:01 2024 -0300

make_type_from_size: fix compare for type reuse

When make_type_from_size is called with a biased type, for an entity
that isn't explicitly biased, we may refrain from reusing the given
type because it doesn't seem to match, and then proceed to create an
exact copy of that type.

Compute earlier the biased status of the expected type, early enough
for the suitability check of the given type.  Modify for_biased
instead of biased_p, so that biased_p remains with the given type's
status for the comparison.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (make_type_from_size): Fix type reuse
by combining biased_p and for_biased earlier.  Hold the
combination in for_biased, adjusting later uses.

Diff:
---
 gcc/ada/gcc-interface/utils.cc | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 0eb9af8d4a2..d8d42f57b89 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1383,6 +1383,11 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   biased_p = (TREE_CODE (type) == INTEGER_TYPE
  && TYPE_BIASED_REPRESENTATION_P (type));
 
+  /* FOR_BIASED initially refers to the entity's representation,
+not to its type's.  The type we're to return must take both
+into account.  */
+  for_biased |= biased_p;
+
   /* Integer types with precision 0 are forbidden.  */
   if (size == 0)
size = 1;
@@ -1394,12 +1399,10 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
  || size > (Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE))
break;
 
-  biased_p |= for_biased;
-
   /* The type should be an unsigned type if the original type is unsigned
 or if the lower bound is constant and non-negative or if the type is
 biased, see E_Signed_Integer_Subtype case of gnat_to_gnu_entity.  */
-  if (type_unsigned_for_rm (type) || biased_p)
+  if (type_unsigned_for_rm (type) || for_biased)
new_type = make_unsigned_type (size);
   else
new_type = make_signed_type (size);
@@ -1409,7 +1412,7 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   /* Copy the name to show that it's essentially the same type and
 not a subrange type.  */
   TYPE_NAME (new_type) = TYPE_NAME (type);
-  TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p;
+  TYPE_BIASED_REPRESENTATION_P (new_type) = for_biased;
   SET_TYPE_RM_SIZE (new_type, bitsize_int (size));
   return new_type;


[gcc(refs/users/aoliva/heads/testme)] Follow only proper TYPE_DEBUG_TYPE

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:0803a2d3d173cf0153d9c6777b42f54d2a193d96

commit 0803a2d3d173cf0153d9c6777b42f54d2a193d96
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:10:29 2024 -0300

Follow only proper TYPE_DEBUG_TYPE

TYPE_DEBUG_TYPE's storage is shared with other sorts of references to
types, so it shouldn't be accessed unless TYPE_CAN_HAVE_DEBUG_TYPE_P
holds.


for  gcc/ada/ChangeLog

* gcc-interface/misc.cc (gnat_get_array_descr_info): Only follow
TYPE_DEBUG_TYPE if TYPE_CAN_HAVE_DEBUG_TYPE_P.

Diff:
---
 gcc/ada/gcc-interface/misc.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index 4f6f6774fe7..f77629ce70b 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -967,7 +967,8 @@ gnat_get_array_descr_info (const_tree const_type,
 
   while (true)
{
- if (TYPE_DEBUG_TYPE (source_element_type))
+ if (TYPE_CAN_HAVE_DEBUG_TYPE_P (source_element_type)
+ && TYPE_DEBUG_TYPE (source_element_type))
source_element_type = TYPE_DEBUG_TYPE (source_element_type);
  else if (TYPE_IS_PADDING_P (source_element_type))
source_element_type


[gcc(refs/users/aoliva/heads/testme)] Avoid dropping bits from num/den in fixed-point types

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:d47c7fee5148a9ec1226bba9bc85ab9a3366e7e2

commit d47c7fee5148a9ec1226bba9bc85ab9a3366e7e2
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:54 2024 -0300

Avoid dropping bits from num/den in fixed-point types

We used to use an unsigned 128-bit type to hold the numerator and
denominator used to represent the delta of a fixed-point type in debug
information, but there are cases in which that was not enough, and
more significant bits silently overflowed and got omitted from debug
information.

Introduce a mode in which UI_to_gnu selects a wide-enough unsigned
type, and use that to convert numerator and denominator.


for  gcc/ada/ChangeLog

* gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
wide enough unsigned type.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
numerator and denominator of fixed-point types.

Diff:
---
 gcc/ada/gcc-interface/cuintp.cc | 47 ++---
 gcc/ada/gcc-interface/decl.cc   | 15 +
 2 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/gcc/ada/gcc-interface/cuintp.cc b/gcc/ada/gcc-interface/cuintp.cc
index cdf6c019750..ad345096282 100644
--- a/gcc/ada/gcc-interface/cuintp.cc
+++ b/gcc/ada/gcc-interface/cuintp.cc
@@ -35,6 +35,7 @@
 #include "tree.h"
 #include "inchash.h"
 #include "fold-const.h"
+#include "stor-layout.h"
 
 #include "ada.h"
 #include "types.h"
@@ -67,7 +68,8 @@ build_cst_from_int (tree type, HOST_WIDE_INT low)
 /* Similar to UI_To_Int, but return a GCC INTEGER_CST or REAL_CST node,
depending on whether TYPE is an integral or real type.  Overflow is tested
by the constant-folding used to build the node.  TYPE is the GCC type of
-   the resulting node.  */
+   the resulting node.  If TYPE is NULL, an unsigned integer type wide enough
+   to hold the entire constant is selected.  */
 
 tree
 UI_To_gnu (Uint Input, tree type)
@@ -77,8 +79,10 @@ UI_To_gnu (Uint Input, tree type)
  any such possible value for intermediate computations and then rely on a
  conversion back to TYPE to perform the bias adjustment when need be.  */
   tree comp_type
-= TREE_CODE (type) == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type)
-  ? get_base_type (type) : type;
+= (!type ? gnat_type_for_size (32, 0)
+   : (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_BIASED_REPRESENTATION_P (type))
+   ? get_base_type (type) : type);
   tree gnu_ret;
 
   if (Input <= Uint_Direct_Last)
@@ -88,6 +92,7 @@ UI_To_gnu (Uint Input, tree type)
   Int Idx = (*Uints_Ptr)[Input - Uint_Table_Start].Loc;
   Pos Length = (*Uints_Ptr)[Input - Uint_Table_Start].Length;
   Int First = (*Udigits_Ptr)[Idx];
+  tree_code code = First < 0 ? MINUS_EXPR : PLUS_EXPR;
   tree gnu_base;
 
   gcc_assert (Length > 0);
@@ -99,26 +104,34 @@ UI_To_gnu (Uint Input, tree type)
 convert the final result back to the incoming type later on.  */
   if (!SCALAR_FLOAT_TYPE_P (comp_type) && TYPE_PRECISION (comp_type) < 32)
comp_type = gnat_type_for_size (32, 0);
+  else if (!type && TYPE_UNSIGNED (comp_type))
+   /* Choose a signed type, so that we can detect overflow.  */
+   comp_type = make_signed_type (TYPE_PRECISION (comp_type));
 
   gnu_base = build_cst_from_int (comp_type, Base);
 
   gnu_ret = build_cst_from_int (comp_type, First);
-  if (First < 0)
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (MINUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
-  else
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (PLUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
+  for (Idx++, Length--; Length; Idx++, Length--)
+   for (;;)
+ {
+   tree next_ret = fold_build2 (code, comp_type,
+fold_build2 (MULT_EXPR, comp_type,
+ gnu_ret, gnu_base),
+build_cst_from_int
+(comp_type, (*Udigits_Ptr)[Idx]));
+   if (!TREE_OVERFLOW (next_ret) || type)
+ {
+   gnu_ret = next_ret;
+   break;
+ }
+   comp_type = make_signed_type (TYPE_PRECISION (comp_type) * 2);
+   gnu_base = convert (comp_type, gnu_base);
+   gnu_ret = 

[gcc/aoliva/heads/testme] (5 commits) make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

2024-06-28 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 8f9705aadea... make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops

It previously pointed to:

 dec24e79d4e... Avoid dropping bits from num/den in fixed-point types

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  dec24e7... Avoid dropping bits from num/den in fixed-point types
  9235979... Map unpacked type to packed deduped type for debug info
  c0c2a61... make_type_from_size: fix compare for type reuse
  d16dbd4... Follow only proper TYPE_DEBUG_TYPE


Summary of changes (added commits):
---

  8f9705a... make_type_from_size avoid TYPE_DEBUG_TYPE / TREE_TYPE loops
  2e886d9... Map unpacked type to packed deduped type for debug info
  cdfb1ef... make_type_from_size: fix compare for type reuse
  0803a2d... Follow only proper TYPE_DEBUG_TYPE
  d47c7fe... Avoid dropping bits from num/den in fixed-point types


[gcc(refs/users/aoliva/heads/testme)] Avoid dropping bits from num/den in fixed-point types

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:dec24e79d4efe7f5b34c62b68ead75b9910e1a3b

commit dec24e79d4efe7f5b34c62b68ead75b9910e1a3b
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:54 2024 -0300

Avoid dropping bits from num/den in fixed-point types

We used to use an unsigned 128-bit type to hold the numerator and
denominator used to represent the delta of a fixed-point type in debug
information, but there are cases in which that was not enough, and
more significant bits silently overflowed and got omitted from debug
information.

Introduce a mode in which UI_to_gnu selects a wide-enough unsigned
type, and use that to convert numerator and denominator.


for  gcc/ada/ChangeLog

* gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
wide enough unsigned type.
* gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
numerator and denominator of fixed-point types.

Diff:
---
 gcc/ada/gcc-interface/cuintp.cc | 47 ++---
 gcc/ada/gcc-interface/decl.cc   | 15 +
 2 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/gcc/ada/gcc-interface/cuintp.cc b/gcc/ada/gcc-interface/cuintp.cc
index cdf6c019750..ad345096282 100644
--- a/gcc/ada/gcc-interface/cuintp.cc
+++ b/gcc/ada/gcc-interface/cuintp.cc
@@ -35,6 +35,7 @@
 #include "tree.h"
 #include "inchash.h"
 #include "fold-const.h"
+#include "stor-layout.h"
 
 #include "ada.h"
 #include "types.h"
@@ -67,7 +68,8 @@ build_cst_from_int (tree type, HOST_WIDE_INT low)
 /* Similar to UI_To_Int, but return a GCC INTEGER_CST or REAL_CST node,
depending on whether TYPE is an integral or real type.  Overflow is tested
by the constant-folding used to build the node.  TYPE is the GCC type of
-   the resulting node.  */
+   the resulting node.  If TYPE is NULL, an unsigned integer type wide enough
+   to hold the entire constant is selected.  */
 
 tree
 UI_To_gnu (Uint Input, tree type)
@@ -77,8 +79,10 @@ UI_To_gnu (Uint Input, tree type)
  any such possible value for intermediate computations and then rely on a
  conversion back to TYPE to perform the bias adjustment when need be.  */
   tree comp_type
-= TREE_CODE (type) == INTEGER_TYPE && TYPE_BIASED_REPRESENTATION_P (type)
-  ? get_base_type (type) : type;
+= (!type ? gnat_type_for_size (32, 0)
+   : (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_BIASED_REPRESENTATION_P (type))
+   ? get_base_type (type) : type);
   tree gnu_ret;
 
   if (Input <= Uint_Direct_Last)
@@ -88,6 +92,7 @@ UI_To_gnu (Uint Input, tree type)
   Int Idx = (*Uints_Ptr)[Input - Uint_Table_Start].Loc;
   Pos Length = (*Uints_Ptr)[Input - Uint_Table_Start].Length;
   Int First = (*Udigits_Ptr)[Idx];
+  tree_code code = First < 0 ? MINUS_EXPR : PLUS_EXPR;
   tree gnu_base;
 
   gcc_assert (Length > 0);
@@ -99,26 +104,34 @@ UI_To_gnu (Uint Input, tree type)
 convert the final result back to the incoming type later on.  */
   if (!SCALAR_FLOAT_TYPE_P (comp_type) && TYPE_PRECISION (comp_type) < 32)
comp_type = gnat_type_for_size (32, 0);
+  else if (!type && TYPE_UNSIGNED (comp_type))
+   /* Choose a signed type, so that we can detect overflow.  */
+   comp_type = make_signed_type (TYPE_PRECISION (comp_type));
 
   gnu_base = build_cst_from_int (comp_type, Base);
 
   gnu_ret = build_cst_from_int (comp_type, First);
-  if (First < 0)
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (MINUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
-  else
-   for (Idx++, Length--; Length; Idx++, Length--)
- gnu_ret = fold_build2 (PLUS_EXPR, comp_type,
-fold_build2 (MULT_EXPR, comp_type,
- gnu_ret, gnu_base),
-build_cst_from_int (comp_type,
-(*Udigits_Ptr)[Idx]));
+  for (Idx++, Length--; Length; Idx++, Length--)
+   for (;;)
+ {
+   tree next_ret = fold_build2 (code, comp_type,
+fold_build2 (MULT_EXPR, comp_type,
+ gnu_ret, gnu_base),
+build_cst_from_int
+(comp_type, (*Udigits_Ptr)[Idx]));
+   if (!TREE_OVERFLOW (next_ret) || type)
+ {
+   gnu_ret = next_ret;
+   break;
+ }
+   comp_type = make_signed_type (TYPE_PRECISION (comp_type) * 2);
+   gnu_base = convert (comp_type, gnu_base);
+   gnu_ret = 

[gcc(refs/users/aoliva/heads/testme)] Map unpacked type to packed deduped type for debug info

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:92359793fc3d8c94a6704e518555807227b21bea

commit 92359793fc3d8c94a6704e518555807227b21bea
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:27 2024 -0300

Map unpacked type to packed deduped type for debug info

Avoid creating unnecessary copies of types in make_type_from_size.
Cache the packed version of a biased type in TYPE_DEBUG_TYPE, so as to
map the unpacked type to it.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (make_type_from_size): Cache packed
variant, and map unpacked type to it in debug info.

for  gcc/testsuite/ChangeLog

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/utils.cc  | 19 +++
 gcc/testsuite/gnat.dg/bias1.adb |  3 ++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index d8d42f57b89..daf8d7ccdc5 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1399,6 +1399,15 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
  || size > (Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE))
break;
 
+  /* If we've already created this type, the base type is supposed
+to map to it.  Check that it is what we expect.  */
+  if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
+ && (new_type = TYPE_DEBUG_TYPE (type))
+ && TYPE_PRECISION (new_type) == size
+ && ((TREE_CODE (new_type) == INTEGER_TYPE
+  && TYPE_BIASED_REPRESENTATION_P (new_type)) == for_biased))
+   return new_type;
+
   /* The type should be an unsigned type if the original type is unsigned
 or if the lower bound is constant and non-negative or if the type is
 biased, see E_Signed_Integer_Subtype case of gnat_to_gnu_entity.  */
@@ -1414,6 +1423,16 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   TYPE_NAME (new_type) = TYPE_NAME (type);
   TYPE_BIASED_REPRESENTATION_P (new_type) = for_biased;
   SET_TYPE_RM_SIZE (new_type, bitsize_int (size));
+
+  /* Enable us to avoid creating the same narrower type multiple
+times, and avoid duplication in debug information, by mapping
+the wider type to the narrower version.  If biasing is
+different, we use the narrower type for debug information.  */
+  if (TYPE_CAN_HAVE_DEBUG_TYPE_P (type)
+ && !TYPE_DEBUG_TYPE (type)
+ && biased_p == for_biased)
+   SET_TYPE_DEBUG_TYPE (type, new_type);
+
   return new_type;
 
 case RECORD_TYPE:
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index 016a159b692..d9a00a1aa45 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,6 +1,7 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
+--  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -31,4 +32,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
\ No newline at end of file
+end Bias1;


[gcc(refs/users/aoliva/heads/testme)] make_type_from_size: fix compare for type reuse

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:c0c2a6152c78b54f3cc6737b667bf1aa53929713

commit c0c2a6152c78b54f3cc6737b667bf1aa53929713
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:11:01 2024 -0300

make_type_from_size: fix compare for type reuse

When make_type_from_size is called with a biased type, for an entity
that isn't explicitly biased, we may refrain from reusing the given
type because it doesn't seem to match, and then proceed to create an
exact copy of that type.

Compute earlier the biased status of the expected type, early enough
for the suitability check of the given type.  Modify for_biased
instead of biased_p, so that biased_p remains with the given type's
status for the comparison.


for  gcc/ada/ChangeLog

* gcc-interface/utils.cc (make_type_from_size): Fix type reuse
by combining biased_p and for_biased earlier.  Hold the
combination in for_biased, adjusting later uses.

Diff:
---
 gcc/ada/gcc-interface/utils.cc | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 0eb9af8d4a2..d8d42f57b89 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -1383,6 +1383,11 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   biased_p = (TREE_CODE (type) == INTEGER_TYPE
  && TYPE_BIASED_REPRESENTATION_P (type));
 
+  /* FOR_BIASED initially refers to the entity's representation,
+not to its type's.  The type we're to return must take both
+into account.  */
+  for_biased |= biased_p;
+
   /* Integer types with precision 0 are forbidden.  */
   if (size == 0)
size = 1;
@@ -1394,12 +1399,10 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
  || size > (Enable_128bit_Types ? 128 : LONG_LONG_TYPE_SIZE))
break;
 
-  biased_p |= for_biased;
-
   /* The type should be an unsigned type if the original type is unsigned
 or if the lower bound is constant and non-negative or if the type is
 biased, see E_Signed_Integer_Subtype case of gnat_to_gnu_entity.  */
-  if (type_unsigned_for_rm (type) || biased_p)
+  if (type_unsigned_for_rm (type) || for_biased)
new_type = make_unsigned_type (size);
   else
new_type = make_signed_type (size);
@@ -1409,7 +1412,7 @@ make_type_from_size (tree type, tree size_tree, bool 
for_biased)
   /* Copy the name to show that it's essentially the same type and
 not a subrange type.  */
   TYPE_NAME (new_type) = TYPE_NAME (type);
-  TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p;
+  TYPE_BIASED_REPRESENTATION_P (new_type) = for_biased;
   SET_TYPE_RM_SIZE (new_type, bitsize_int (size));
   return new_type;


[gcc(refs/users/aoliva/heads/testme)] Follow only proper TYPE_DEBUG_TYPE

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:d16dbd45239df22a2adfffcc248c7958224d2e04

commit d16dbd45239df22a2adfffcc248c7958224d2e04
Author: Alexandre Oliva 
Date:   Thu Jun 27 09:10:29 2024 -0300

Follow only proper TYPE_DEBUG_TYPE

TYPE_DEBUG_TYPE's storage is shared with other sorts of references to
types, so it shouldn't be accessed unless TYPE_CAN_HAVE_DEBUG_TYPE_P
holds.


for  gcc/ada/ChangeLog

* gcc-interface/misc.cc (gnat_get_array_descr_info): Only follow
TYPE_DEBUG_TYPE if TYPE_CAN_HAVE_DEBUG_TYPE_P.

Diff:
---
 gcc/ada/gcc-interface/misc.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index 4f6f6774fe7..f77629ce70b 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -967,7 +967,8 @@ gnat_get_array_descr_info (const_tree const_type,
 
   while (true)
{
- if (TYPE_DEBUG_TYPE (source_element_type))
+ if (TYPE_CAN_HAVE_DEBUG_TYPE_P (source_element_type)
+ && TYPE_DEBUG_TYPE (source_element_type))
source_element_type = TYPE_DEBUG_TYPE (source_element_type);
  else if (TYPE_IS_PADDING_P (source_element_type))
source_element_type


[gcc/aoliva/heads/testme] (55 commits) Avoid dropping bits from num/den in fixed-point types

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 dec24e79d4e... Avoid dropping bits from num/den in fixed-point types

It previously pointed to:

 6668cf365ef... [i386] drop static decls moved to mingw/winnt-dll.cc

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  6668cf3... [i386] drop static decls moved to mingw/winnt-dll.cc
  c658106... [libstdc++] [testsuite] defer to check_vect_support* [PR115


Summary of changes (added commits):
---

  dec24e7... Avoid dropping bits from num/den in fixed-point types
  9235979... Map unpacked type to packed deduped type for debug info
  c0c2a61... make_type_from_size: fix compare for type reuse
  d16dbd4... Follow only proper TYPE_DEBUG_TYPE
  73ad57c... libstdc++: Fix std::codecvt for e (*)
  95faa1b... [libstdc++] [testsuite] defer to check_vect_support* [PR115 (*)
  bcdbb85... Avoid global bitmap space in ranger. (*)
  dafa750... libstdc++: Fix std::format for chrono::duration with unsign (*)
  8fd84bc... libstdc++: Add debug assertions to std::vector [PR103 (*)
  cfc9fa3... libstdc++: Enable more debug assertions during constant eva (*)
  5c8b7fc... ada: Remove last uses of System.Address_Operations in runti (*)
  fdbc04d... ada: Reject ambiguous function calls in interpolated string (*)
  d4c9907... ada: Add missing dimension information for target names (*)
  432b8a3... ada: Fix array-manipulating code in Mdll (*)
  089bb07... ada: Bug using user defined string literals with interpolat (*)
  60ca710... ada: Overridden operation field not correctly set for contr (*)
  3cb7e22... ada: Implement first half of Generalized Finalization (*)
  9449524... i386: Refactor vcvttps2qq/vcvtqq2ps patterns. (*)
  4385dc9... vect: support direct conversion under x86-64-v3. (*)
  e5f8a39... vect: Support v4hi -> v4qi. (*)
  c320a7e... vect: generate suitable convert insn for int -> int, float  (*)
  b55798c... RISC-V: Add testcases for vector truncate after .SAT_SUB (*)
  2280e88... LoongArch: NFC: Dedup and sort the comment in loongarch_pri (*)
  94aade0... LoongArch: Tweak IOR rtx_cost for bstrins (*)
  b8153b5... Fix wrong cost of MEM when addr is a lea. (*)
  212441e... Internal-fn: Support new IFN SAT_TRUNC for unsigned scalar  (*)
  f2476a2... Vect: Support truncate after .SAT_SUB pattern in zip (*)
  c7cb0dd... tree-optimization/115652 - amend last fix (*)
  b7ba067... tree-optimization/115493 - complete previous fix (*)
  9c56dc7... Daily bump. (*)
  0731985... libstdc++: Add script to update docs for a new release bran (*)
  6eff233... libstdc++: Remove duplicate test (*)
  e65b662... libstdc++: Increase timeouts for PSTL tests in debug mode [ (*)
  003ce8a... libstdc++: Work around some PSTL test failures for debug mo (*)
  0ca8d56... libstdc++: Fix std::chrono::tzdb to work with vanguard form (*)
  629257b... tree-optimization/115629 - missed tail merging (*)
  86a3dbe... RISC-V: Update testcase comments to point to PSABI rather t (*)
  aa89e86... RISC-V: Consolidate amo testcase variants (*)
  08498f8... RISC-V: Rename amo testcases (*)
  e499aee... rs6000, change altivec*-runnable.c test file names (*)
  0699de2... rs6000, altivec-2-runnable.c update the require-effective-t (*)
  4bf719b... rs6000, altivec-1-runnable.c update the require-effective-t (*)
  47b68cd... [committed] Remove compromised sh test (*)
  03a3dff... [committed][RISC-V] Fix expected output for thead store pai (*)
  f80db54... tree-optimization/115652 - adjust insertion gsi for SLP (*)
  7a9b535... Record edge true/false value for gcov (*)
  0bf0021... Use the term MC/DC in help for gcov --conditions (*)
  229bf66... Add section on MC/DC in gcov manual (*)
  19f630e... Use auto_vec for memory release on return (*)
  ad20ad7... arm: make arm_predict_doloop_p reject loops with calls (*)
  7fada36... [aarch64] Add support for -mcpu=grace (*)
  f4e847b... i386: Remove declaration of unused functions (*)
  812c70b... rs6000: Fix wrong RTL patterns for vector merge high/low sh (*)
  62520e4... rs6000: Fix wrong RTL patterns for vector merge high/low ch (*)
  453b1d2... tree-optimization/115646 - ICE with pow shrink-wrapping fro (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testme' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc/aoliva/heads/testbase] (51 commits) libstdc++: Fix std::codecvt for e

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 73ad57c244c... libstdc++: Fix std::codecvt for e

It previously pointed to:

 5a10ac0e592... optab: Add isnormal_optab for isnormal builtin

Diff:

Summary of changes (added commits):
---

  73ad57c... libstdc++: Fix std::codecvt for e (*)
  95faa1b... [libstdc++] [testsuite] defer to check_vect_support* [PR115 (*)
  bcdbb85... Avoid global bitmap space in ranger. (*)
  dafa750... libstdc++: Fix std::format for chrono::duration with unsign (*)
  8fd84bc... libstdc++: Add debug assertions to std::vector [PR103 (*)
  cfc9fa3... libstdc++: Enable more debug assertions during constant eva (*)
  5c8b7fc... ada: Remove last uses of System.Address_Operations in runti (*)
  fdbc04d... ada: Reject ambiguous function calls in interpolated string (*)
  d4c9907... ada: Add missing dimension information for target names (*)
  432b8a3... ada: Fix array-manipulating code in Mdll (*)
  089bb07... ada: Bug using user defined string literals with interpolat (*)
  60ca710... ada: Overridden operation field not correctly set for contr (*)
  3cb7e22... ada: Implement first half of Generalized Finalization (*)
  9449524... i386: Refactor vcvttps2qq/vcvtqq2ps patterns. (*)
  4385dc9... vect: support direct conversion under x86-64-v3. (*)
  e5f8a39... vect: Support v4hi -> v4qi. (*)
  c320a7e... vect: generate suitable convert insn for int -> int, float  (*)
  b55798c... RISC-V: Add testcases for vector truncate after .SAT_SUB (*)
  2280e88... LoongArch: NFC: Dedup and sort the comment in loongarch_pri (*)
  94aade0... LoongArch: Tweak IOR rtx_cost for bstrins (*)
  b8153b5... Fix wrong cost of MEM when addr is a lea. (*)
  212441e... Internal-fn: Support new IFN SAT_TRUNC for unsigned scalar  (*)
  f2476a2... Vect: Support truncate after .SAT_SUB pattern in zip (*)
  c7cb0dd... tree-optimization/115652 - amend last fix (*)
  b7ba067... tree-optimization/115493 - complete previous fix (*)
  9c56dc7... Daily bump. (*)
  0731985... libstdc++: Add script to update docs for a new release bran (*)
  6eff233... libstdc++: Remove duplicate test (*)
  e65b662... libstdc++: Increase timeouts for PSTL tests in debug mode [ (*)
  003ce8a... libstdc++: Work around some PSTL test failures for debug mo (*)
  0ca8d56... libstdc++: Fix std::chrono::tzdb to work with vanguard form (*)
  629257b... tree-optimization/115629 - missed tail merging (*)
  86a3dbe... RISC-V: Update testcase comments to point to PSABI rather t (*)
  aa89e86... RISC-V: Consolidate amo testcase variants (*)
  08498f8... RISC-V: Rename amo testcases (*)
  e499aee... rs6000, change altivec*-runnable.c test file names (*)
  0699de2... rs6000, altivec-2-runnable.c update the require-effective-t (*)
  4bf719b... rs6000, altivec-1-runnable.c update the require-effective-t (*)
  47b68cd... [committed] Remove compromised sh test (*)
  03a3dff... [committed][RISC-V] Fix expected output for thead store pai (*)
  f80db54... tree-optimization/115652 - adjust insertion gsi for SLP (*)
  7a9b535... Record edge true/false value for gcov (*)
  0bf0021... Use the term MC/DC in help for gcov --conditions (*)
  229bf66... Add section on MC/DC in gcov manual (*)
  19f630e... Use auto_vec for memory release on return (*)
  ad20ad7... arm: make arm_predict_doloop_p reject loops with calls (*)
  7fada36... [aarch64] Add support for -mcpu=grace (*)
  f4e847b... i386: Remove declaration of unused functions (*)
  812c70b... rs6000: Fix wrong RTL patterns for vector merge high/low sh (*)
  62520e4... rs6000: Fix wrong RTL patterns for vector merge high/low ch (*)
  453b1d2... tree-optimization/115646 - ICE with pow shrink-wrapping fro (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testbase' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc r12-10585] [libstdc++] [testsuite] defer to check_vect_support* [PR115454]

2024-06-27 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:95ca5f458251e21123e45ec52c38d629d39cd0e4

commit r12-10585-g95ca5f458251e21123e45ec52c38d629d39cd0e4
Author: Alexandre Oliva 
Date:   Thu Jun 27 08:44:54 2024 -0300

[libstdc++] [testsuite] defer to check_vect_support* [PR115454]

The newly-added testcase overrides the default dg-do action set by
check_vect_support_and_set_flags (in libstdc++-dg/conformance.exp), so
it attempts to run the test even if runtime vector support is not
available.

Remove the explicit dg-do directive, so that the default is honored,
and the test is run if vector support is found, and only compiled
otherwise.


for  libstdc++-v3/ChangeLog

PR libstdc++/115454
* testsuite/experimental/simd/pr115454_find_last_set.cc: Defer
to check_vect_support_and_set_flags's default dg-do action.

(cherry picked from commit 95faa1bea7bdc7f92fcccb3543bfcbc8184c5e5b)

Diff:
---
 libstdc++-v3/testsuite/experimental/simd/pr115454_find_last_set.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/experimental/simd/pr115454_find_last_set.cc 
b/libstdc++-v3/testsuite/experimental/simd/pr115454_find_last_set.cc
index 25a713b4e94..4ade8601f27 100644
--- a/libstdc++-v3/testsuite/experimental/simd/pr115454_find_last_set.cc
+++ b/libstdc++-v3/testsuite/experimental/simd/pr115454_find_last_set.cc
@@ -1,5 +1,4 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run { target *-*-* } }
 // { dg-require-effective-target c++17 }
 // { dg-additional-options "-march=x86-64-v4" { target avx512f_runtime } }
 // { dg-require-cmath "" }


[gcc(refs/users/aoliva/heads/testme)] [i386] drop static decls moved to mingw/winnt-dll.cc

2024-06-26 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:6668cf365efd5eba5efc39313f0cdabb8f9eb658

commit 6668cf365efd5eba5efc39313f0cdabb8f9eb658
Author: Alexandre Oliva 
Date:   Wed Jun 26 07:04:58 2024 -0300

[i386] drop static decls moved to mingw/winnt-dll.cc

Diff:
---
 gcc/config/i386/i386.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index b0ef1bf08e0..1f71ed04be6 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -104,8 +104,6 @@ along with GCC; see the file COPYING3.  If not see
 /* This file should be included last.  */
 #include "target-def.h"
 
-static rtx legitimize_dllimport_symbol (rtx, bool);
-static rtx legitimize_pe_coff_extern_decl (rtx, bool);
 static void ix86_print_operand_address_as (FILE *, rtx, addr_space_t, bool);
 static void ix86_emit_restore_reg_using_pop (rtx, bool = false);


[gcc/aoliva/heads/testme] (144 commits) [libstdc++] [testsuite] defer to check_vect_support* [PR115

2024-06-26 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 c6581064248... [libstdc++] [testsuite] defer to check_vect_support* [PR115

It previously pointed to:

 441c8117368... [libstdc++] [testsuite] no libatomic for vxworks

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  441c811... [libstdc++] [testsuite] no libatomic for vxworks
  82ef090... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]


Summary of changes (added commits):
---

  c658106... [libstdc++] [testsuite] defer to check_vect_support* [PR115
  5a10ac0... optab: Add isnormal_optab for isnormal builtin (*)
  680eda8... optab: Add isfinite_optab for isfinite builtin (*)
  eed2027... [libstdc++] [testsuite] no libatomic for vxworks (*)
  54d2339... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281] (*)
  aac00d0... Optimize a < 0 ? -1 : 0 to (signed)a >> 31. (*)
  01f8b10... [PATCH 11/11] Handle subroutine types in CodeView (*)
  009b329... [PATCH 10/11] Handle bitfields for CodeView (*)
  3800a78... diagnostics: introduce diagnostic-global-context.cc (*)
  d681c52... diagnostics: eliminate various implicit uses of global_dc (*)
  1796790... testsuite: use check-jsonschema for validating .sarif files (*)
  9fe669c... Daily bump. (*)
  737449e... c++: decltype of capture proxy of ref [PR115504] (*)
  3e64a68... [PATCH 09/11] Handle arrays for CodeView (*)
  0a5f559... [PATCH 08/11] Handle unions for CodeView. (*)
  7d413a8... libstdc++: Simplify std::valarray initialization helpers (*)
  0381445... modula2: tidyup remove unused procedures and unused paramet (*)
  9d8021d... libstdc++: Replace viewcvs links in docs with cgit links (*)
  fc382a3... c++: ICE with __has_unique_object_representations [PR115476 (*)
  b1e828d... [PATCH v2 3/3] RISC-V: cmpmem for RISCV with V extension (*)
  d16355c... PR modula2/115540 gcc/m2/mc-boot-ch/Gtermios.cc error retur (*)
  1ea95cc... Add param for bb limit to invoke fast_vrp. (*)
  ed6ffc4... c++: ICE with generic lambda and pack expansion [PR115425] (*)
  71f484d... c++: ICE with __dynamic_cast redecl [PR115501] (*)
  3b9b8d6... ira: Scale save/restore costs of callee save registers with (*)
  9f168b4... PR modula2/115536 Expression is evaluated incorrectly when  (*)
  7c28228... [committed] Fix fr30-elf newlib build failure with late-com (*)
  b87e19a... late-combine: Honor targetm.cannot_copy_insn_p (*)
  06ebb7c... c++: alias CTAD and copy deduction guide [PR115198] (*)
  e3915c1... c++: using non-dep array var of unknown bound [PR115358] (*)
  21f1073... Fix PR c/115587, uninitialized variable in c_parser_omp_loo (*)
  3587bfa... GORI cleanups (*)
  d27049a... doc: gccint: Fix typos in jump_table_data description (*)
  b621506... Add a debug counter for late-combine (*)
  7107574... libatomic: Add rcpc3 128-bit atomic operations for AArch64 (*)
  d4db77c... SPARC: fix internal error with -mv8plus on 64-bit Linux (*)
  7048005... rs6000: Properly default-disable late-combine passes [PR106 (*)
  b694bf4... Revert one of the force_subreg changes (*)
  17b368b... MIPS: Implement vcond_mask optabs for MSA (*)
  0b45643... MIPS: Output $0 for conditional trap if !ISA_HAS_COND_TRAPI (*)
  30db579... aarch64: Add DLL import/export to AArch64 target (*)
  ed20fee... Adjust DLL import/export implementation for AArch64 (*)
  337632e... aarch64: Add selectany attribute handling (*)
  a86d7e1... Rename functions for reuse in AArch64 (*)
  63512c7... Extract ix86 dllimport implementation to mingw (*)
  104d06c... Move mingw_* declarations to the mingw folder (*)
  777cc6a... c: Fix ICE related to incomplete structures in C23 [PR11493 (*)
  4f86d2a... [PATCH 07/11] Handle structs and classes for CodeView (*)
  41ff74a... [committed][RISC-V] Fix some of the testsuite fallout from  (*)
  55947b3... Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook mode (*)
  7eddf6e... vms: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  bcd1b7a... rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  fafd878... go: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  f774721... c-family: Add Warning property to Wnrvo option [PR115624] (*)
  4c8b085... Make transitive relations an oracle option (*)
  c3be325... Daily bump. (*)
  a424318... [PATCH v2 2/3] RISC-V: setmem for RISCV with V extension (*)
  580c37f... RISC-V: Add dg-remove-option for z* extensions (*)
  f02c70d... Fortran: fix passing of optional dummy as actual to optiona (*)
  d8b05ae... PR tree-optimization/113673: Avoid load merging when potent (*)
  c43c74f... tree-optimization/115602 - SLP CSE results in cycles (*)
  2f83ea8... tree-optimization/115528 - fix vect alignment analysis for  (*)
  0de0476... Fix MinGW option -mcrtdll= (*)
  a6f7e3c... Regenerate common.opt.urls (*)
  792f97b... Add a late-combine pass [PR106594] (*)
  5185274... rtl-ssa: Rework _ignoring interfaces (*)
  ae13af2... tree-optimization/115599 

[gcc/aoliva/heads/testbase] (143 commits) optab: Add isnormal_optab for isnormal builtin

2024-06-26 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 5a10ac0e592... optab: Add isnormal_optab for isnormal builtin

It previously pointed to:

 301927d9335... ada: Reference to nonexistent operator in reduction express

Diff:

Summary of changes (added commits):
---

  5a10ac0... optab: Add isnormal_optab for isnormal builtin (*)
  680eda8... optab: Add isfinite_optab for isfinite builtin (*)
  eed2027... [libstdc++] [testsuite] no libatomic for vxworks (*)
  54d2339... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281] (*)
  aac00d0... Optimize a < 0 ? -1 : 0 to (signed)a >> 31. (*)
  01f8b10... [PATCH 11/11] Handle subroutine types in CodeView (*)
  009b329... [PATCH 10/11] Handle bitfields for CodeView (*)
  3800a78... diagnostics: introduce diagnostic-global-context.cc (*)
  d681c52... diagnostics: eliminate various implicit uses of global_dc (*)
  1796790... testsuite: use check-jsonschema for validating .sarif files (*)
  9fe669c... Daily bump. (*)
  737449e... c++: decltype of capture proxy of ref [PR115504] (*)
  3e64a68... [PATCH 09/11] Handle arrays for CodeView (*)
  0a5f559... [PATCH 08/11] Handle unions for CodeView. (*)
  7d413a8... libstdc++: Simplify std::valarray initialization helpers (*)
  0381445... modula2: tidyup remove unused procedures and unused paramet (*)
  9d8021d... libstdc++: Replace viewcvs links in docs with cgit links (*)
  fc382a3... c++: ICE with __has_unique_object_representations [PR115476 (*)
  b1e828d... [PATCH v2 3/3] RISC-V: cmpmem for RISCV with V extension (*)
  d16355c... PR modula2/115540 gcc/m2/mc-boot-ch/Gtermios.cc error retur (*)
  1ea95cc... Add param for bb limit to invoke fast_vrp. (*)
  ed6ffc4... c++: ICE with generic lambda and pack expansion [PR115425] (*)
  71f484d... c++: ICE with __dynamic_cast redecl [PR115501] (*)
  3b9b8d6... ira: Scale save/restore costs of callee save registers with (*)
  9f168b4... PR modula2/115536 Expression is evaluated incorrectly when  (*)
  7c28228... [committed] Fix fr30-elf newlib build failure with late-com (*)
  b87e19a... late-combine: Honor targetm.cannot_copy_insn_p (*)
  06ebb7c... c++: alias CTAD and copy deduction guide [PR115198] (*)
  e3915c1... c++: using non-dep array var of unknown bound [PR115358] (*)
  21f1073... Fix PR c/115587, uninitialized variable in c_parser_omp_loo (*)
  3587bfa... GORI cleanups (*)
  d27049a... doc: gccint: Fix typos in jump_table_data description (*)
  b621506... Add a debug counter for late-combine (*)
  7107574... libatomic: Add rcpc3 128-bit atomic operations for AArch64 (*)
  d4db77c... SPARC: fix internal error with -mv8plus on 64-bit Linux (*)
  7048005... rs6000: Properly default-disable late-combine passes [PR106 (*)
  b694bf4... Revert one of the force_subreg changes (*)
  17b368b... MIPS: Implement vcond_mask optabs for MSA (*)
  0b45643... MIPS: Output $0 for conditional trap if !ISA_HAS_COND_TRAPI (*)
  30db579... aarch64: Add DLL import/export to AArch64 target (*)
  ed20fee... Adjust DLL import/export implementation for AArch64 (*)
  337632e... aarch64: Add selectany attribute handling (*)
  a86d7e1... Rename functions for reuse in AArch64 (*)
  63512c7... Extract ix86 dllimport implementation to mingw (*)
  104d06c... Move mingw_* declarations to the mingw folder (*)
  777cc6a... c: Fix ICE related to incomplete structures in C23 [PR11493 (*)
  4f86d2a... [PATCH 07/11] Handle structs and classes for CodeView (*)
  41ff74a... [committed][RISC-V] Fix some of the testsuite fallout from  (*)
  55947b3... Replace {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE with new hook mode (*)
  7eddf6e... vms: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  bcd1b7a... rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  fafd878... go: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  f774721... c-family: Add Warning property to Wnrvo option [PR115624] (*)
  4c8b085... Make transitive relations an oracle option (*)
  c3be325... Daily bump. (*)
  a424318... [PATCH v2 2/3] RISC-V: setmem for RISCV with V extension (*)
  580c37f... RISC-V: Add dg-remove-option for z* extensions (*)
  f02c70d... Fortran: fix passing of optional dummy as actual to optiona (*)
  d8b05ae... PR tree-optimization/113673: Avoid load merging when potent (*)
  c43c74f... tree-optimization/115602 - SLP CSE results in cycles (*)
  2f83ea8... tree-optimization/115528 - fix vect alignment analysis for  (*)
  0de0476... Fix MinGW option -mcrtdll= (*)
  a6f7e3c... Regenerate common.opt.urls (*)
  792f97b... Add a late-combine pass [PR106594] (*)
  5185274... rtl-ssa: Rework _ignoring interfaces (*)
  ae13af2... tree-optimization/115599 - reassoc qsort comparator issue (*)
  6274f10... rs6000: Eliminate unnecessary byte swaps for duplicated con (*)
  ea8061f... fwprop: invoke change_is_worthwhile to judge if a replaceme (*)
  d820db3... [PATCH 06/11] Handle enums for CodeView (*)
  29fec9e... [PATCH 05/11] Handle const and varible modifiers for CodeVi (*)
  35cca2c... 

[gcc r15-1640] [libstdc++] [testsuite] no libatomic for vxworks

2024-06-25 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:eed2027843409bf3afd03053d95760bdacb8fbf6

commit r15-1640-geed2027843409bf3afd03053d95760bdacb8fbf6
Author: Alexandre Oliva 
Date:   Wed Jun 26 02:08:27 2024 -0300

[libstdc++] [testsuite] no libatomic for vxworks

libatomic hasn't been ported to vxworks.  Most of the stdatomic.h and
 underlying requirements are provided by builtins and libgcc,
and the vxworks libc already provides remaining __atomic symbols, so
porting libatomic doesn't seem to make sense.

However, some of the target arch-only tests in
add_options_for_libatomic cover vxworks targets, so we end up
attempting to link libatomic in, even though it's not there.
Preempt those too-broad tests.


Co-Authored-By: Marc Poulhiès 

for  libstdc++-v3/ChangeLog

* testsuite/lib/dg-options.exp (add_options_for_libatomic):
None for *-*-vxworks*.

Diff:
---
 libstdc++-v3/testsuite/lib/dg-options.exp | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp 
b/libstdc++-v3/testsuite/lib/dg-options.exp
index 84f9e3ebc73..0d77fb029b0 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -338,6 +338,11 @@ proc atomic_link_flags { paths } {
 }
 
 proc add_options_for_libatomic { flags } {
+# We don't (need to) build libatomic for vxworks.  Don't try to
+# link it in, even on arches that support libatomic.
+if { [istarget *-*-vxworks*] } {
+   return $flags
+}
 if { [istarget hppa*-*-hpux*]
 || ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
 || [istarget riscv*-*-*]


[gcc r15-1639] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-25 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:54d2339c9f87f702e02e571a5460e11c19e1c02f

commit r15-1639-g54d2339c9f87f702e02e571a5460e11c19e1c02f
Author: Alexandre Oliva 
Date:   Wed Jun 26 02:08:18 2024 -0300

[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts by
clamping the shift counts below the bit width of the types (e.g. at 15
for 16-bit vector elements), but (uint16_t)32768 >> (uint16_t)16 is
well defined (because of promotion to 32-bit int) and must yield 0,
not 1 (as before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the vectorization we no longer performed
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization, and Christophe Lyon suggested a further
simplification.


Co-Authored-By: Richard Earnshaw 

for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

Diff:
---
 gcc/testsuite/gcc.target/arm/simd/mve-vshr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c 
b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef9ed8..03078de49c6 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -9,6 +9,8 @@
   void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * 
__restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \
 int i; \
 for (i=0; i= (unsigned)(BITS))  \
+   __builtin_unreachable();\
   dest[i] = a[i] OP b[i];  \
 }  \
 }


[gcc(refs/users/aoliva/heads/testme)] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-24 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:82ef09057697f0df8557570673a59e501dd49316

commit 82ef09057697f0df8557570673a59e501dd49316
Author: Alexandre Oliva 
Date:   Thu Jun 20 07:26:40 2024 -0300

[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts by
clamping the shift counts below the bit width of the types (e.g. at 15
for 16-bit vector elements), but (uint16_t)32768 >> (uint16_t)16 is
well defined (because of promotion to 32-bit int) and must yield 0,
not 1 (as before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the vectorization we no longer performed
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization, and Christophe Lyon suggested a further
simplification.


Co-Authored-By: Richard Earnshaw 

for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

Diff:
---
 gcc/testsuite/gcc.target/arm/simd/mve-vshr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c 
b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef9ed8..03078de49c6 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -9,6 +9,8 @@
   void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * 
__restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \
 int i; \
 for (i=0; i= (unsigned)(BITS))  \
+   __builtin_unreachable();\
   dest[i] = a[i] OP b[i];  \
 }  \
 }


[gcc/aoliva/heads/testme] (2 commits) [libstdc++] [testsuite] no libatomic for vxworks

2024-06-24 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 441c8117368... [libstdc++] [testsuite] no libatomic for vxworks

It previously pointed to:

 7c42cd96b6b... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  7c42cd9... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]


Summary of changes (added commits):
---

  441c811... [libstdc++] [testsuite] no libatomic for vxworks
  82ef090... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]


[gcc(refs/users/aoliva/heads/testme)] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-21 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:7c42cd96b6bffca9122910e170f6d6f264320ecb

commit 7c42cd96b6bffca9122910e170f6d6f264320ecb
Author: Alexandre Oliva 
Date:   Thu Jun 20 07:26:40 2024 -0300

[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts
involving 8-bit and 16-bit integral types by clamping the shift count
at the highest in-range shift count, but that was not correct: such
narrow shifts expect integral promotion, so larger shift counts should
be accepted.  (int16_t)32768 >> (int16_t)16 must yield 0, not 1 (as
before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the incorrect clamping we no longer perform
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization.


Co-Authored-By: Richard Earnshaw 

for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

Diff:
---
 gcc/testsuite/gcc.target/arm/simd/mve-vshr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c 
b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef9ed8f..03078de49c65 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -9,6 +9,8 @@
   void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * 
__restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \
 int i; \
 for (i=0; i= (unsigned)(BITS))  \
+   __builtin_unreachable();\
   dest[i] = a[i] OP b[i];  \
 }  \
 }


[gcc/aoliva/heads/testme] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-21 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 7c42cd96b6bf... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

It previously pointed to:

 d47e880e8b59... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  d47e880... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]


Summary of changes (added commits):
---

  7c42cd9... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]


[gcc(refs/users/aoliva/heads/testme)] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-20 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:d47e880e8b5994d3aed1bc911972f120b1f7ff41

commit d47e880e8b5994d3aed1bc911972f120b1f7ff41
Author: Alexandre Oliva 
Date:   Thu Jun 20 07:26:40 2024 -0300

[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts
involving 8-bit and 16-bit integral types by clamping the shift count
at the highest in-range shift count, but that was not correct: such
narrow shifts expect integral promotion, so larger shift counts should
be accepted.  (int16_t)32768 >> (int16_t)16 must yield 0, not 1 (as
before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the incorrect clamping we no longer perform
needs to be adjusted.  Instead of nobbling the test, Richard Earnshaw
suggested annotating the test with the expected ranges so as to enable
the optimization.


for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Add expected ranges.

Diff:
---
 gcc/testsuite/gcc.target/arm/simd/mve-vshr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c 
b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef9ed8f..35cd0e75be5d 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -9,6 +9,8 @@
   void test_ ## NAME ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t * 
__restrict__ dest, TYPE##BITS##_t *a, TYPE##BITS##_t *b) { \
 int i; \
 for (i=0; i= __CHAR_BIT__ * sizeof (TYPE##BITS##_t))\
+   __builtin_unreachable();\
   dest[i] = a[i] OP b[i];  \
 }  \
 }


[gcc/aoliva/heads/testme] (274 commits) [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-20 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 d47e880e8b59... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

It previously pointed to:

 62c77d907211... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  62c77d9... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]
  cfd7f93... [alpha] adjust MEM alignment for block move [PR115459]
  e75f9b7... [i386] restore recompute to override opts after change [PR1
  aa6f08f... [libstdc++] [testsuite] require cmath for [PR114359]


Summary of changes (added commits):
---

  d47e880... [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]
  301927d... ada: Reference to nonexistent operator in reduction express (*)
  4c98b69... ada: Fix checking of SPARK RM on ghost with concurrent part (*)
  a688a02... ada: Rewrite generic formal/actual matching (*)
  36bd573... ada: Replace "All" argument to Extensions_Allowed pragma wi (*)
  ecb84b0... ada: Crash on selected component of formal derived type in  (*)
  3c6dcd1... ada: Fix inlining of fixed-lower-bound array for GNATprove (*)
  c5d7daa... ada: Fix assertion failure during analysis of instantiation (*)
  e8e0306... ada: Fix composition of primitive equality for untagged rec (*)
  980fddd... ada: New pragma to default all interrupts to system. (*)
  3a16f19... ada: Fix bogus error with "=" operator on array of private  (*)
  9cf9514... ada: Fix crash on real literal in declare expression of exp (*)
  ce59982... ada: Enforce strict alignment for array types with aliased  (*)
  664e47e... ada: Update Bit Ordering references in GNAT Reference Manua (*)
  7e05732... ada: Add documentation for Subprogram_Variant aspect and pr (*)
  4f6ee98... ada: Streamline propagation of controlled flags on types (*)
  09ed91d... ada: Remove redundant conditions from freezing code (*)
  42305c7... ada: Fix style in freezing code (*)
  ad264cb... ada: Remove Max_Entry_Queue_Depth pragma/aspect (*)
  c207c2d... ada: Couple of minor fixes in GNAT Reference Manual (*)
  7abf222... ada: Add Dump_Buffers hooks for code coverage (*)
  2e28085... ada: Do not compute Has_Controlled_Component twice during f (*)
  cfd7b02... ada: Fix minor issues in comments (*)
  20f5d5e... ada: Document -gnatd_w for CCG (*)
  23c332e... ada: Change messages for -gnatw.v to warnings (*)
  0f906fe... ada: Convert -gnatw.n messages to warnings (*)
  82531c6... ada: Add switch for suppressing info messages (*)
  d1c0759... ada: Treat Info-Warnings as Info messages (*)
  6e5f911... ada: Update documentation for 'Super (*)
  cba9a6c... ada: Improve preprocessor error handling. (*)
  21b54da... ada: Fix list of attributes defined by Ada 2022 (*)
  4867cc8... i386: Fix some ISA bit test in option_override (*)
  ccaa39a... Fortran: Auto array allocation with function dependencies [ (*)
  46bb4ce... tree-optimization/114413 - SLP CSE after permute optimizati (*)
  bea447a... build: Fix missing variable quotes and typo (*)
  ecbc96b... vect: Tighten an assertion for lane-reducing in transform (*)
  b9c369d... vect: Use an array to replace 3 relevant variables (*)
  0726f1c... vect: Use one reduction_type local variable (*)
  a944e57... vect: Remove duplicated check on reduction operand (*)
  70466e6... vect: Add a function to check lane-reducing stmt (*)
  ebfffb6... Daily bump. (*)
  6d6587b... Revert "build: Fix missing variable quotes" (*)
  a334189... Revert "Build: Fix typo ac_cv_search_pthread_crate" (*)
  f0204ae... [PATCH v2] RISC-V: Remove float vector eqne pattern (*)
  e03583e... RISC-V: Promote Zaamo/Zalrsc to a when using an old binutil (*)
  25860fd... bitint: Fix up lowering of COMPLEX_EXPR [PR115544] (*)
  6f6ea27... i386: Zhaoxin shijidadao enablement (*)
  0982552... xtensa: Eliminate double MEMW insertions for volatile memor (*)
  bcb9dad... libstdc++: Consistently indent  with tabs (*)
  5d156a9... libstdc++: Add noexcept to some std::promise shared state i (*)
  9651d60... libstdc++: Add conditional noexcept to std::pair default ct (*)
  954f901... Fortran: fix for CHARACTER(len=*) dummies with bind(C) [PR1 (*)
  3dfc28d... arm: Add support for MVE Tail-Predicated Low Overhead Loops (*)
  5d0c1b4... doloop: Add support for predicated vectorized loops (*)
  8088374... Build: Fix typo ac_cv_search_pthread_crate (*)
  be18486... RISC-V: Add testcases for unsigned .SAT_SUB vector form 10 (*)
  f127582... RISC-V: Add testcases for unsigned .SAT_SUB vector form 9 (*)
  ff3729e... RISC-V: Add testcases for unsigned .SAT_SUB vector form 8 (*)
  be8dc4b... RISC-V: Add testcases for unsigned .SAT_SUB vector form 7 (*)
  337b211... RISC-V: Add testcases for unsigned .SAT_SUB vector form 6 (*)
  d5054ec... RISC-V: Add testcases for unsigned .SAT_SUB vector form 5 (*)
  0fe8c5f... RISC-V: Add testcases for unsigned .SAT_SUB vector form 4 (*)
  b3a3446... 

[gcc/aoliva/heads/testbase] (273 commits) ada: Reference to nonexistent operator in reduction express

2024-06-20 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 301927d93356... ada: Reference to nonexistent operator in reduction express

It previously pointed to:

 5288935d30c4... [libstdc++] [testsuite] require cmath for c++23 cmath tests

Diff:

Summary of changes (added commits):
---

  301927d... ada: Reference to nonexistent operator in reduction express (*)
  4c98b69... ada: Fix checking of SPARK RM on ghost with concurrent part (*)
  a688a02... ada: Rewrite generic formal/actual matching (*)
  36bd573... ada: Replace "All" argument to Extensions_Allowed pragma wi (*)
  ecb84b0... ada: Crash on selected component of formal derived type in  (*)
  3c6dcd1... ada: Fix inlining of fixed-lower-bound array for GNATprove (*)
  c5d7daa... ada: Fix assertion failure during analysis of instantiation (*)
  e8e0306... ada: Fix composition of primitive equality for untagged rec (*)
  980fddd... ada: New pragma to default all interrupts to system. (*)
  3a16f19... ada: Fix bogus error with "=" operator on array of private  (*)
  9cf9514... ada: Fix crash on real literal in declare expression of exp (*)
  ce59982... ada: Enforce strict alignment for array types with aliased  (*)
  664e47e... ada: Update Bit Ordering references in GNAT Reference Manua (*)
  7e05732... ada: Add documentation for Subprogram_Variant aspect and pr (*)
  4f6ee98... ada: Streamline propagation of controlled flags on types (*)
  09ed91d... ada: Remove redundant conditions from freezing code (*)
  42305c7... ada: Fix style in freezing code (*)
  ad264cb... ada: Remove Max_Entry_Queue_Depth pragma/aspect (*)
  c207c2d... ada: Couple of minor fixes in GNAT Reference Manual (*)
  7abf222... ada: Add Dump_Buffers hooks for code coverage (*)
  2e28085... ada: Do not compute Has_Controlled_Component twice during f (*)
  cfd7b02... ada: Fix minor issues in comments (*)
  20f5d5e... ada: Document -gnatd_w for CCG (*)
  23c332e... ada: Change messages for -gnatw.v to warnings (*)
  0f906fe... ada: Convert -gnatw.n messages to warnings (*)
  82531c6... ada: Add switch for suppressing info messages (*)
  d1c0759... ada: Treat Info-Warnings as Info messages (*)
  6e5f911... ada: Update documentation for 'Super (*)
  cba9a6c... ada: Improve preprocessor error handling. (*)
  21b54da... ada: Fix list of attributes defined by Ada 2022 (*)
  4867cc8... i386: Fix some ISA bit test in option_override (*)
  ccaa39a... Fortran: Auto array allocation with function dependencies [ (*)
  46bb4ce... tree-optimization/114413 - SLP CSE after permute optimizati (*)
  bea447a... build: Fix missing variable quotes and typo (*)
  ecbc96b... vect: Tighten an assertion for lane-reducing in transform (*)
  b9c369d... vect: Use an array to replace 3 relevant variables (*)
  0726f1c... vect: Use one reduction_type local variable (*)
  a944e57... vect: Remove duplicated check on reduction operand (*)
  70466e6... vect: Add a function to check lane-reducing stmt (*)
  ebfffb6... Daily bump. (*)
  6d6587b... Revert "build: Fix missing variable quotes" (*)
  a334189... Revert "Build: Fix typo ac_cv_search_pthread_crate" (*)
  f0204ae... [PATCH v2] RISC-V: Remove float vector eqne pattern (*)
  e03583e... RISC-V: Promote Zaamo/Zalrsc to a when using an old binutil (*)
  25860fd... bitint: Fix up lowering of COMPLEX_EXPR [PR115544] (*)
  6f6ea27... i386: Zhaoxin shijidadao enablement (*)
  0982552... xtensa: Eliminate double MEMW insertions for volatile memor (*)
  bcb9dad... libstdc++: Consistently indent  with tabs (*)
  5d156a9... libstdc++: Add noexcept to some std::promise shared state i (*)
  9651d60... libstdc++: Add conditional noexcept to std::pair default ct (*)
  954f901... Fortran: fix for CHARACTER(len=*) dummies with bind(C) [PR1 (*)
  3dfc28d... arm: Add support for MVE Tail-Predicated Low Overhead Loops (*)
  5d0c1b4... doloop: Add support for predicated vectorized loops (*)
  8088374... Build: Fix typo ac_cv_search_pthread_crate (*)
  be18486... RISC-V: Add testcases for unsigned .SAT_SUB vector form 10 (*)
  f127582... RISC-V: Add testcases for unsigned .SAT_SUB vector form 9 (*)
  ff3729e... RISC-V: Add testcases for unsigned .SAT_SUB vector form 8 (*)
  be8dc4b... RISC-V: Add testcases for unsigned .SAT_SUB vector form 7 (*)
  337b211... RISC-V: Add testcases for unsigned .SAT_SUB vector form 6 (*)
  d5054ec... RISC-V: Add testcases for unsigned .SAT_SUB vector form 5 (*)
  0fe8c5f... RISC-V: Add testcases for unsigned .SAT_SUB vector form 4 (*)
  b3a3446... RISC-V: Add testcases for unsigned .SAT_SUB vector form 3 (*)
  8c52adc... libstdc++: Fix warning regressions in  (*)
  c6a9ab8... build: Fix missing variable quotes (*)
  a73744a... Improve gcc.dg/vect/bb-slp-32.c testcase (*)
  dbb7181... Fortran: Set the vptr of a class typed result. (*)
  2314108... xtensa: constantsynth: Reforge to fix some non-fatal issues (*)
  eb549f1... RISC-V: Add testcases for unsigned .SAT_ADD vector form 8 (*)
  ed94699... RISC-V: Add 

[gcc r15-1303] Revert "map packed field type to unpacked for debug info"

2024-06-13 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:78352395e94fda574fa2d9c711c57f9099807f2b

commit r15-1303-g78352395e94fda574fa2d9c711c57f9099807f2b
Author: Alexandre Oliva 
Date:   Thu Jun 13 21:03:35 2024 -0300

Revert "map packed field type to unpacked for debug info"

This reverts commit ea5c9f25241ae0658180afbcad7f4e298352f561.

Diff:
---
 gcc/ada/gcc-interface/decl.cc   | 4 
 gcc/testsuite/gnat.dg/bias1.adb | 3 +--
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index e97ff64a4805..8b72c96c4396 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7786,7 +7786,6 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
   /* If a size is specified, adjust the field's type to it.  */
   if (gnu_size)
 {
-  tree debug_field_type = gnu_field_type;
   tree orig_field_type;
 
   /* If the field's type is justified modular, we would need to remove
@@ -7845,9 +7844,6 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
  && !DECL_P (TYPE_NAME (gnu_field_type)))
create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, true,
  debug_info_p, gnat_field);
-
-  if (debug_info_p && gnu_field_type != debug_field_type)
-   SET_TYPE_DEBUG_TYPE (gnu_field_type, debug_field_type);
 }
 
   /* Otherwise (or if there was an error), don't specify a position.  */
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index d9a00a1aa458..016a159b692d 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,7 +1,6 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
---  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -32,4 +31,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
+end Bias1;
\ No newline at end of file


[gcc(refs/users/aoliva/heads/testme)] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-13 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:62c77d9072119d54a5b1d58e234652cd07a54dce

commit 62c77d9072119d54a5b1d58e234652cd07a54dce
Author: Alexandre Oliva 
Date:   Thu Jun 13 06:13:56 2024 -0300

[testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

The test was too optimistic, alas.  We used to vectorize shifts
involving 8-bit and 16-bit integral types by clamping the shift count
at the highest in-range shift count, but that was not correct: such
narrow shifts expect integral promotion, so larger shift counts should
be accepted.  (int16_t)32768 >> (int16_t)16 must yield 0, not 1 (as
before the fix).

Unfortunately, in the gimple model of vector units, such large shift
counts wouldn't be well-defined, so we won't vectorize such shifts any
more, unless we can tell they're in range or undefined.

So the test that expected the incorrect clamping we no longer perform
needs to be adjusted.


for  gcc/testsuite/ChangeLog

PR tree-optimization/113281
* gcc.target/arm/simd/mve-vshr.c: Adjust expectations.

Diff:
---
 gcc/testsuite/gcc.target/arm/simd/mve-vshr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c 
b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
index 8c7adef9ed8f..8253427db6ef 100644
--- a/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
+++ b/gcc/testsuite/gcc.target/arm/simd/mve-vshr.c
@@ -56,9 +56,9 @@ FUNC_IMM(u, uint, 8, 16, >>, vshrimm)
 /* MVE has only 128-bit vectors, so we can vectorize only half of the
functions above.  */
 /* Vector right shifts use vneg and left shifts.  */
-/* { dg-final { scan-assembler-times {vshl.s[0-9]+\tq[0-9]+, q[0-9]+} 3 } } */
-/* { dg-final { scan-assembler-times {vshl.u[0-9]+\tq[0-9]+, q[0-9]+} 3 } } */
-/* { dg-final { scan-assembler-times {vneg.s[0-9]+\tq[0-9]+, q[0-9]+} 6 } } */
+/* { dg-final { scan-assembler-times {vshl.s[0-9]+\tq[0-9]+, q[0-9]+} 1 } } */
+/* { dg-final { scan-assembler-times {vshl.u[0-9]+\tq[0-9]+, q[0-9]+} 1 } } */
+/* { dg-final { scan-assembler-times {vneg.s[0-9]+\tq[0-9]+, q[0-9]+} 2 } } */
 
 
 /* Shift by immediate.  */


[gcc(refs/users/aoliva/heads/testme)] [alpha] adjust MEM alignment for block move [PR115459]

2024-06-13 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:cfd7f936696c66c92c43db0a5fddd4dcebab69ee

commit cfd7f936696c66c92c43db0a5fddd4dcebab69ee
Author: Alexandre Oliva 
Date:   Thu Jun 13 03:52:17 2024 -0300

[alpha] adjust MEM alignment for block move [PR115459]

Before issuing loads or stores for a block move, adjust the MEM
alignments if analysis of the addresses enabled the inference of
stricter alignment.  This ensures that the MEMs are sufficiently
aligned for the corresponding insns, which avoids trouble in case of
e.g. substitutions into SUBREGs.


for  gcc/ChangeLog

PR target/115459
* config/alpha/alpha.cc (alpha_expand_block_move): Adjust
MEMs to match inferred alignment.

Diff:
---
 gcc/config/alpha/alpha.cc | 12 
 1 file changed, 12 insertions(+)

diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index 1126cea1f7ba..e090e74b9d07 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -3820,6 +3820,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
src_align = 16;
}
+
+  if (MEM_P (orig_src) && MEM_ALIGN (orig_src) < src_align)
+   {
+ orig_src = shallow_copy_rtx (orig_src);
+ set_mem_align (orig_src, src_align);
+   }
 }
 
   tmp = XEXP (orig_dst, 0);
@@ -3841,6 +3847,12 @@ alpha_expand_block_move (rtx operands[])
   else if (a >= 16 && c % 2 == 0)
dst_align = 16;
}
+
+  if (MEM_P (orig_dst) && MEM_ALIGN (orig_dst) < dst_align)
+   {
+ orig_dst = shallow_copy_rtx (orig_dst);
+ set_mem_align (orig_dst, dst_align);
+   }
 }
 
   ofs = 0;


[gcc/aoliva/heads/testme] [alpha] adjust MEM alignment for block move [PR115459]

2024-06-13 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 cfd7f936696c... [alpha] adjust MEM alignment for block move [PR115459]

It previously pointed to:

 cc291d63cde4... [alpha] adjust MEM alignment for block move [PR115459]

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  cc291d6... [alpha] adjust MEM alignment for block move [PR115459]


Summary of changes (added commits):
---

  cfd7f93... [alpha] adjust MEM alignment for block move [PR115459]


[gcc(refs/users/aoliva/heads/testme)] [alpha] adjust MEM alignment for block move [PR115459]

2024-06-13 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:cc291d63cde41bd7d9c159ed679cabc0c34126c9

commit cc291d63cde41bd7d9c159ed679cabc0c34126c9
Author: Alexandre Oliva 
Date:   Thu Jun 13 03:52:17 2024 -0300

[alpha] adjust MEM alignment for block move [PR115459]

Before issuing loads or stores for a block move, adjust the MEM
alignments if analysis of the addresses enabled the inference of
stricter alignment.  This ensures that the MEMs are sufficiently
aligned for the corresponding insns, which avoids trouble in case of
e.g. substitutions into SUBREGs.


for  gcc/ChangeLog

PR target/115459
* config/alpha/alpha.cc (alpha_expand_block_move): Adjust
MEMs to match inferred alignment.

Diff:


[gcc(refs/users/aoliva/heads/testme)] [i386] restore recompute to override opts after change [PR113719]

2024-06-12 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e75f9b7a5974b31a0e9722d507e313305a39b207

commit e75f9b7a5974b31a0e9722d507e313305a39b207
Author: Alexandre Oliva 
Date:   Thu Jun 13 00:12:47 2024 -0300

[i386] restore recompute to override opts after change [PR113719]

The first patch for PR113719 regressed gcc.dg/ipa/iinline-attr.c on
toolchains configured to --enable-frame-pointer, because the
optimization node created within handle_optimize_attribute had
flag_omit_frame_pointer incorrectly set, whereas
default_optimization_node didn't.  With this difference,
can_inline_edge_by_limits_p flagged an optimization mismatch and we
refused to inline the function that had a redundant optimization flag
into one that didn't, which is exactly what is tested for there.

This patch restores the calls to ix86_default_align and
ix86_recompute_optlev_based_flags that used to be, and ought to be,
issued during TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE, but preserves the
intent of the original change, of having those functions called at
different spots within ix86_option_override_internal.  To that end,
the remaining bits were refactored into a separate function, that was
in turn adjusted to operate on explicitly-passed opts and opts_set,
rather than going for their global counterparts.


for  gcc/ChangeLog

PR target/113719
* config/i386/i386-options.cc
(ix86_override_options_after_change_1): Add opts and opts_set
parms, operate on them, after factoring out of...
(ix86_override_options_after_change): ... this.  Restore calls
of ix86_default_align and ix86_recompute_optlev_based_flags.
(ix86_option_override_internal): Call the factored-out bits.

Diff:
---
 gcc/config/i386/i386-options.cc | 59 -
 1 file changed, 40 insertions(+), 19 deletions(-)

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index f2cecc0e2545..7fa7f6774e9c 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -1911,37 +1911,58 @@ ix86_recompute_optlev_based_flags (struct gcc_options 
*opts,
 }
 }
 
-/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+/* Implement part of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
 
-void
-ix86_override_options_after_change (void)
+static void
+ix86_override_options_after_change_1 (struct gcc_options *opts,
+ struct gcc_options *opts_set)
 {
+#define OPTS_SET_P(OPTION) opts_set->x_ ## OPTION
+#define OPTS(OPTION) opts->x_ ## OPTION
+
   /* Disable unrolling small loops when there's explicit
  -f{,no}unroll-loop.  */
-  if ((OPTION_SET_P (flag_unroll_loops))
- || (OPTION_SET_P (flag_unroll_all_loops)
-&& flag_unroll_all_loops))
+  if ((OPTS_SET_P (flag_unroll_loops))
+ || (OPTS_SET_P (flag_unroll_all_loops)
+&& OPTS (flag_unroll_all_loops)))
 {
-  if (!OPTION_SET_P (ix86_unroll_only_small_loops))
-   ix86_unroll_only_small_loops = 0;
+  if (!OPTS_SET_P (ix86_unroll_only_small_loops))
+   OPTS (ix86_unroll_only_small_loops) = 0;
   /* Re-enable -frename-registers and -fweb if funroll-loops
 enabled.  */
-  if (!OPTION_SET_P (flag_web))
-   flag_web = flag_unroll_loops;
-  if (!OPTION_SET_P (flag_rename_registers))
-   flag_rename_registers = flag_unroll_loops;
+  if (!OPTS_SET_P (flag_web))
+   OPTS (flag_web) = OPTS (flag_unroll_loops);
+  if (!OPTS_SET_P (flag_rename_registers))
+   OPTS (flag_rename_registers) = OPTS (flag_unroll_loops);
   /* -fcunroll-grow-size default follws -f[no]-unroll-loops.  */
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_unroll_loops
-|| flag_peel_loops
-|| optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_unroll_loops)
+|| OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
   else
 {
-  if (!OPTION_SET_P (flag_cunroll_grow_size))
-   flag_cunroll_grow_size = flag_peel_loops || optimize >= 3;
+  if (!OPTS_SET_P (flag_cunroll_grow_size))
+   OPTS (flag_cunroll_grow_size)
+ = (OPTS (flag_peel_loops)
+|| OPTS (optimize) >= 3);
 }
 
+#undef OPTS
+#undef OPTS_SET_P
+}
+
+/* Implement TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE hook.  */
+
+void
+ix86_override_options_after_change (void)
+{
+  ix86_default_align (_options);
+
+  ix86_recompute_optlev_based_flags (_options, _options_set);
+
+  ix86_override_options_after_change_1 (_options, _options_set);
 }
 
 /* Clear stack slot assignments remembered from previous functions.
@@ -2488,7 +2509,7 @@ ix86_option_override_internal (bool main_args_p,
 
   ix86_recompute_optlev_based_flags (opts, opts_set);
 
-  

[gcc(refs/users/aoliva/heads/testme)] [libstdc++] [testsuite] require cmath for [PR114359]

2024-06-12 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:aa6f08f66334fdef3d0d33177698be247e1724ad

commit aa6f08f66334fdef3d0d33177698be247e1724ad
Author: Alexandre Oliva 
Date:   Wed Jun 12 21:36:42 2024 -0300

[libstdc++] [testsuite] require cmath for [PR114359]

When !_GLIBCXX_USE_C99_MATH_TR1, binomial_distribution doesn't use the
optimized algorithm that was fixed in response to PR114359.  Without
that optimized algorithm, operator() ends up looping very very long
for the test, to the point that it would time out by several orders of
magnitude, without even exercising the optimized algorithm that we're
testing for regressions.  Arrange for the test to be skipped if that
bit won't be exercised.


for  libstdc++-v3/ChangeLog

PR libstdc++/114359
* testsuite/26_numerics/random/binomial_distribution/114359.cc:
Require cmath.

Diff:
---
 .../26_numerics/random/binomial_distribution/114359.cc  | 13 +
 1 file changed, 13 insertions(+)

diff --git 
a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc 
b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
index c1e4c380bf91..12d967dcbfd3 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/114359.cc
@@ -2,6 +2,19 @@
 
 // Bug 114359 - std::binomial_distribution hangs in infinite loop
 
+// { dg-require-cmath "" }
+
+// The requirement above is not strictly true.  The test should work
+// without cmath, and it probably does, but without cmath,
+// binomial_distribution::operator() skips the optimized algorithm and
+// calls _M_waiting to loop a gazillion times.  On aarch64-rtems6
+// qemu, that loop takes over 5 minutes to go through a small fraction
+// of the iteration space (__x at 22k, limited at 1G; __sum at 2e-5,
+// limited at 0.69).  The bug we're regression-testing here was in the
+// cmath-requiring bit, so even if this could conceivably not time out
+// on a really fast machine, there's hardly any reason to exercise
+// this extreme case.
+
 #include 
 
 int main()


[gcc/aoliva/heads/testme] (130 commits) [i386] restore recompute to override opts after change [PR1

2024-06-12 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 e75f9b7a5974... [i386] restore recompute to override opts after change [PR1

It previously pointed to:

 606e815b8427... [testsuite] add linkonly to dg-additional-sources [PR115295

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  606e815... [testsuite] add linkonly to dg-additional-sources [PR115295
  4f96af2... map packed field type to unpacked for debug info
  bed2675... [libstdc++] [testsuite] require cmath for c++23 cmath tests
  1c784e7... [libstdc++] [testsuite] xfail double-prec from_chars for fl


Summary of changes (added commits):
---

  e75f9b7... [i386] restore recompute to override opts after change [PR1
  aa6f08f... [libstdc++] [testsuite] require cmath for [PR114359]
  5288935... [libstdc++] [testsuite] require cmath for c++23 cmath tests (*)
  6c3b01d... [libstdc++] [testsuite] xfail double-prec from_chars for fl (*)
  074c1fc... c++: repeated export using (*)
  f8356d6... c++: module std and exception_ptr (*)
  7bf072e... c++: fix testcase diagnostics (*)
  eaff4d6... Whitespace cleanup for target-supports.exp (*)
  e35f4ea... pretty_printer: unbreak build on aarch64 [PR115465] (*)
  439c0cc... RISC-V: Allow any temp register to be used in amo tests (*)
  6343adc... RISC-V: Fix amoadd call arguments (*)
  8c944f2... RISC-V: Move amo tests into subfolder (*)
  c2f0aaf... aarch64: Use bitreverse rtl code instead of unspec [PR11517 (*)
  0256121... match: Improve gimple_bitwise_equal_p and gimple_bitwise_in (*)
  bd6bc35... Move cexpr_stree tree string build into utility function (*)
  bd3a312... libstdc++: Fix std::tr2::dynamic_bitset shift operations [P (*)
  3f2f905... libstdc++: Do not use memset in _Hashtable::clear() (*)
  adcc815... middle-end: Drop __builtin_prefetch calls in autovectorizat (*)
  1cae1a5... pretty_printer: convert chunk_info into a class (*)
  c5e3be4... pretty_printer: make all fields private (*)
  fc47393... pretty_printer: rename instances named "buffer" to "pp" (*)
  d0da347... LoongArch: Use bstrins for "value & (-1u << const)" (*)
  53c7038... LoongArch: Fix mode size comparision in loongarch_expand_co (*)
  7663154... Libatomic: Clean up AArch64 `atomic_16.S' implementation fi (*)
  1af4a84... Libatomic: Make ifunc selector behavior contingent on impor (*)
  6edf6fe... Libatomic: Define per-file identifier macros (*)
  f6b9a06... Libatomic: AArch64: Convert all lse128 assembly to .insn di (*)
  cf5f917... testsuite: Fix expand-return CMSE test for Armv8.1-M [PR115 (*)
  65bd065... arm: Zero/Sign extends for CMSE security on Armv8-M.baselin (*)
  2d6874a... doc: Update Cygwin web link (*)
  acd2ca1... Widening-Mul: Take gsi after_labels instead of start_bb for (*)
  919e88f... doc: Simplify *-*-linux-gnu dependencies (*)
  66f4855... [tree-prof] skip if errors were seen [PR113681] (*)
  89a746f... [testsuite] [arm] test board cflags in multilib.exp (*)
  ea5c9f2... map packed field type to unpacked for debug info (*)
  da57b45... [libstdc++] drop workaround for clang<=7 (*)
  7fa4b33... Daily bump. (*)
  1d496d2... Fix ICE in rtl check due to CONST_WIDE_INT in CONST_VECTOR_ (*)
  0cf6822... c: Add -std=c2y, -std=gnu2y, -Wc23-c2y-compat, C2Y _Generic (*)
  6bc26cc... doc: Remove redundant introduction of x86-64 (*)
  e4244b8... Fix building JIT with musl libc [PR115442] (*)
  2b438a0... vect: Merge loop mask and cond_op mask in fold-left reducti (*)
  1588983... RISC-V: Add Zalrsc amo-op patterns (*)
  0fea902... RISC-V: Add Zalrsc and Zaamo testsuite support (*)
  af139b3... RISC-V: Add basic Zaamo and Zalrsc support (*)
  05b9523... i386: Use CMOV in .SAT_{ADD|SUB} expansion for TARGET_CMOV  (*)
  e7cd8ea... aarch64: Add vector floating point trunc pattern (*)
  53ac88c... C++: Support constexpr strings for asm statements (*)
  6ef8c90... Factor out static_assert constexpr string extraction for re (*)
  2f0c09c... scev query mismatch message (*)
  84c87d1... libstdc++: Add test for chrono::leap_seconds ostream insert (*)
  75299e4... rust: Do not link with libdl and libpthread unconditionally (*)
  a0004fe... PR modula2/114529 Avoid ODR violations in bootstrap transla (*)
  a797398... i386: PR target/115397: AVX512 ternlog vs. -m32 -fPIC const (*)
  8087204... RISC-V: Implement .SAT_SUB for unsigned vector int (*)
  66d6b18... fixincludes: bypass the math_exception fix on __cplusplus (*)
  95161c6... [committed] [RISC-V] Drop dead round_32 test (*)
  097bc0a... Daily bump. (*)
  ec08656... modula2: Fix typos, grammar, and a link (*)
  74ee12f... Move array_bounds warnings into a separate pass. (*)
  9aaf29b... [to-be-committed] [RISC-V] Use bext for extracting a bit in (*)
  d03ff3f... [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for (*)
  6ef8881... libstdc++: [_Hashtable] Optimize destructor (*)
  c3d1153... Fix pr115388.c: plain char could be unsigned by 

[gcc/aoliva/heads/testbase] (129 commits) [libstdc++] [testsuite] require cmath for c++23 cmath tests

2024-06-12 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 5288935d30c4... [libstdc++] [testsuite] require cmath for c++23 cmath tests

It previously pointed to:

 dd6f942c2665... Fix fold-left reduction vectorization with multiple stmt co

Diff:

Summary of changes (added commits):
---

  5288935... [libstdc++] [testsuite] require cmath for c++23 cmath tests (*)
  6c3b01d... [libstdc++] [testsuite] xfail double-prec from_chars for fl (*)
  074c1fc... c++: repeated export using (*)
  f8356d6... c++: module std and exception_ptr (*)
  7bf072e... c++: fix testcase diagnostics (*)
  eaff4d6... Whitespace cleanup for target-supports.exp (*)
  e35f4ea... pretty_printer: unbreak build on aarch64 [PR115465] (*)
  439c0cc... RISC-V: Allow any temp register to be used in amo tests (*)
  6343adc... RISC-V: Fix amoadd call arguments (*)
  8c944f2... RISC-V: Move amo tests into subfolder (*)
  c2f0aaf... aarch64: Use bitreverse rtl code instead of unspec [PR11517 (*)
  0256121... match: Improve gimple_bitwise_equal_p and gimple_bitwise_in (*)
  bd6bc35... Move cexpr_stree tree string build into utility function (*)
  bd3a312... libstdc++: Fix std::tr2::dynamic_bitset shift operations [P (*)
  3f2f905... libstdc++: Do not use memset in _Hashtable::clear() (*)
  adcc815... middle-end: Drop __builtin_prefetch calls in autovectorizat (*)
  1cae1a5... pretty_printer: convert chunk_info into a class (*)
  c5e3be4... pretty_printer: make all fields private (*)
  fc47393... pretty_printer: rename instances named "buffer" to "pp" (*)
  d0da347... LoongArch: Use bstrins for "value & (-1u << const)" (*)
  53c7038... LoongArch: Fix mode size comparision in loongarch_expand_co (*)
  7663154... Libatomic: Clean up AArch64 `atomic_16.S' implementation fi (*)
  1af4a84... Libatomic: Make ifunc selector behavior contingent on impor (*)
  6edf6fe... Libatomic: Define per-file identifier macros (*)
  f6b9a06... Libatomic: AArch64: Convert all lse128 assembly to .insn di (*)
  cf5f917... testsuite: Fix expand-return CMSE test for Armv8.1-M [PR115 (*)
  65bd065... arm: Zero/Sign extends for CMSE security on Armv8-M.baselin (*)
  2d6874a... doc: Update Cygwin web link (*)
  acd2ca1... Widening-Mul: Take gsi after_labels instead of start_bb for (*)
  919e88f... doc: Simplify *-*-linux-gnu dependencies (*)
  66f4855... [tree-prof] skip if errors were seen [PR113681] (*)
  89a746f... [testsuite] [arm] test board cflags in multilib.exp (*)
  ea5c9f2... map packed field type to unpacked for debug info (*)
  da57b45... [libstdc++] drop workaround for clang<=7 (*)
  7fa4b33... Daily bump. (*)
  1d496d2... Fix ICE in rtl check due to CONST_WIDE_INT in CONST_VECTOR_ (*)
  0cf6822... c: Add -std=c2y, -std=gnu2y, -Wc23-c2y-compat, C2Y _Generic (*)
  6bc26cc... doc: Remove redundant introduction of x86-64 (*)
  e4244b8... Fix building JIT with musl libc [PR115442] (*)
  2b438a0... vect: Merge loop mask and cond_op mask in fold-left reducti (*)
  1588983... RISC-V: Add Zalrsc amo-op patterns (*)
  0fea902... RISC-V: Add Zalrsc and Zaamo testsuite support (*)
  af139b3... RISC-V: Add basic Zaamo and Zalrsc support (*)
  05b9523... i386: Use CMOV in .SAT_{ADD|SUB} expansion for TARGET_CMOV  (*)
  e7cd8ea... aarch64: Add vector floating point trunc pattern (*)
  53ac88c... C++: Support constexpr strings for asm statements (*)
  6ef8c90... Factor out static_assert constexpr string extraction for re (*)
  2f0c09c... scev query mismatch message (*)
  84c87d1... libstdc++: Add test for chrono::leap_seconds ostream insert (*)
  75299e4... rust: Do not link with libdl and libpthread unconditionally (*)
  a0004fe... PR modula2/114529 Avoid ODR violations in bootstrap transla (*)
  a797398... i386: PR target/115397: AVX512 ternlog vs. -m32 -fPIC const (*)
  8087204... RISC-V: Implement .SAT_SUB for unsigned vector int (*)
  66d6b18... fixincludes: bypass the math_exception fix on __cplusplus (*)
  95161c6... [committed] [RISC-V] Drop dead round_32 test (*)
  097bc0a... Daily bump. (*)
  ec08656... modula2: Fix typos, grammar, and a link (*)
  74ee12f... Move array_bounds warnings into a separate pass. (*)
  9aaf29b... [to-be-committed] [RISC-V] Use bext for extracting a bit in (*)
  d03ff3f... [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for (*)
  6ef8881... libstdc++: [_Hashtable] Optimize destructor (*)
  c3d1153... Fix pr115388.c: plain char could be unsigned by default [PR (*)
  3472c1b... [to-be-committed] [RISC-V] Use bext for extracting a bit in (*)
  818e760... tree-optimization/115388 - wrong DSE in irreductible region (*)
  e29af8d... Add testcase for PR ada/114708 (*)
  e1c1f12... Add testcase for PR ada/114398 (*)
  4ed9c5d... tree-optimization/115395 - wrong-code with SLP reduction in (*)
  6272444... ada: Add support for No_Implicit_Conditionals to nonbinary  (*)
  add6d89... ada: Storage_Error in indirect call to function returning l (*)
  f5e372e... ada: Derived type with convention C must override 

[gcc r15-1196] [tree-prof] skip if errors were seen [PR113681]

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:66f48557e11a530646e5562c50a75b4b9839f171

commit r15-1196-g66f48557e11a530646e5562c50a75b4b9839f171
Author: Alexandre Oliva 
Date:   Wed Jun 12 00:16:27 2024 -0300

[tree-prof] skip if errors were seen [PR113681]

ipa_tree_profile asserts that the symtab is in IPA_SSA state, but we
don't reach that state and ICE if e.g. ipa-strub passes report errors.
Skip this pass if errors were seen.


for  gcc/ChangeLog

PR tree-optimization/113681
* tree-profile.cc (pass_ipa_tree_profile::gate): Skip if
seen_errors.

for  gcc/testsuite/ChangeLog

PR tree-optimization/113681
* c-c++-common/strub-pr113681.c: New.

Diff:
---
 gcc/testsuite/c-c++-common/strub-pr113681.c | 22 ++
 gcc/tree-profile.cc |  3 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/strub-pr113681.c 
b/gcc/testsuite/c-c++-common/strub-pr113681.c
new file mode 100644
index ..3ef9017b2eb7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/strub-pr113681.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrub=relaxed -fbranch-probabilities" } */
+/* { dg-require-effective-target strub } */
+
+/* Same as torture/strub-inlineable1.c, but with -fbranch-probabilities, to
+   check that IPA tree-profiling won't ICE.  It would when we refrained from
+   running passes that would take it to IPA_SSA, but ran the pass that asserted
+   for IPA_SSA.  */
+
+inline void __attribute__ ((strub ("internal"), always_inline))
+inl_int_ali (void)
+{
+  /* No internal wrapper, so this body ALWAYS gets inlined,
+ but it cannot be called from non-strub contexts.  */
+}
+
+void
+bat (void)
+{
+  /* Not allowed, not a strub context.  */
+  inl_int_ali (); /* { dg-error "context" } */
+}
diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc
index b87c121790c9..e4bb689cef58 100644
--- a/gcc/tree-profile.cc
+++ b/gcc/tree-profile.cc
@@ -2070,7 +2070,8 @@ pass_ipa_tree_profile::gate (function *)
  disabled.  */
   return (!in_lto_p && !flag_auto_profile
  && (flag_branch_probabilities || flag_test_coverage
- || profile_arc_flag || condition_coverage_flag));
+ || profile_arc_flag || condition_coverage_flag)
+ && !seen_error ());
 }
 
 } // anon namespace


[gcc r15-1195] [testsuite] [arm] test board cflags in multilib.exp

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:89a746f2a326ae83c51868271615fe5d7e249c50

commit r15-1195-g89a746f2a326ae83c51868271615fe5d7e249c50
Author: Alexandre Oliva 
Date:   Wed Jun 12 00:16:24 2024 -0300

[testsuite] [arm] test board cflags in multilib.exp

multilib.exp tests for multilib-altering flags in a board's
multilib_flags and skips the test, but if such flags appear in the
board's cflags, with the same distorting effects on tested multilibs,
we fail to skip the test.

Extend the skipping logic to board's cflags as well.


for  gcc/testsuite/ChangeLog

* gcc.target/arm/multilib.exp: Skip based on board cflags too.

Diff:
---
 gcc/testsuite/gcc.target/arm/multilib.exp | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp 
b/gcc/testsuite/gcc.target/arm/multilib.exp
index 4442d5d754bd..12c93bc89d22 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -18,13 +18,15 @@ load_lib gcc-dg.exp
 
 dg-init
 
-if { [board_info [target_info name] exists multilib_flags] 
- && [regexp {(-marm|-mthumb|-march=.*|-mcpu=.*|-mfpu=.*|-mfloat=abi=.*)\y} 
[board_info [target_info name] multilib_flags]] } {
+foreach flagsvar {multilib_flags cflags} {
+  if { [board_info [target_info name] exists $flagsvar] 
+ && [regexp {(-marm|-mthumb|-march=.*|-mcpu=.*|-mfpu=.*|-mfloat=abi=.*)\y} 
[board_info [target_info name] $flagsvar]] } {

 # Multilib flags override anything we can apply to a test, so
 # skip if any of the above options are set there.
-verbose "skipping multilib tests due to multilib_flags setting" 1
+verbose "skipping multilib tests due to $flagsvar setting" 1
 return
+  }
 }
 
 # We don't want to run this test multiple times in a parallel make check.


[gcc r15-1194] map packed field type to unpacked for debug info

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:ea5c9f25241ae0658180afbcad7f4e298352f561

commit r15-1194-gea5c9f25241ae0658180afbcad7f4e298352f561
Author: Alexandre Oliva 
Date:   Wed Jun 12 00:16:22 2024 -0300

map packed field type to unpacked for debug info

We create a distinct type for each field in a packed record with a
gnu_size, but there is no distinct debug information for them.  Use
the same unpacked type for debug information.


for  gcc/ada/ChangeLog

* gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
as the debug type for packed fields.

for  gcc/testsuite/ChangeLog

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/decl.cc   | 4 
 gcc/testsuite/gnat.dg/bias1.adb | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 8b72c96c4396..e97ff64a4805 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7786,6 +7786,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
   /* If a size is specified, adjust the field's type to it.  */
   if (gnu_size)
 {
+  tree debug_field_type = gnu_field_type;
   tree orig_field_type;
 
   /* If the field's type is justified modular, we would need to remove
@@ -7844,6 +7845,9 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
  && !DECL_P (TYPE_NAME (gnu_field_type)))
create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, true,
  debug_info_p, gnat_field);
+
+  if (debug_info_p && gnu_field_type != debug_field_type)
+   SET_TYPE_DEBUG_TYPE (gnu_field_type, debug_field_type);
 }
 
   /* Otherwise (or if there was an error), don't specify a position.  */
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index 016a159b692d..d9a00a1aa458 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,6 +1,7 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
+--  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -31,4 +32,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
\ No newline at end of file
+end Bias1;


[gcc r15-1193] [libstdc++] drop workaround for clang<=7

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:da57b4562c5ada8971b6684b6aad1c996e1ef9cc

commit r15-1193-gda57b4562c5ada8971b6684b6aad1c996e1ef9cc
Author: Alexandre Oliva 
Date:   Wed Jun 12 00:16:20 2024 -0300

[libstdc++] drop workaround for clang<=7

In response to a request in the review of the patch that introduced
_GLIBCXX_CLANG, this patch removes from std/variant an obsolete
workaround for clang 7-.


for  libstdc++-v3/ChangeLog

* include/std/variant: Drop obsolete workaround.

Diff:


[gcc(refs/users/aoliva/heads/testme)] [testsuite] add linkonly to dg-additional-sources [PR115295]

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:606e815b8427976d801e572b8c571bf030a51ff8

commit 606e815b8427976d801e572b8c571bf030a51ff8
Author: Alexandre Oliva 
Date:   Tue Jun 11 21:44:55 2024 -0300

[testsuite] add linkonly to dg-additional-sources [PR115295]

The D testsuite shows it was a mistake to assume that
dg-additional-sources are never to be used for compilation tests.
Even if an output file is specified for compilation, extra module
files can be named and used in the compilation without being flagged
as errors.

Introduce a 'linkonly' flag for dg-additional-sources, and use it in
pr95401.cc, so that its additional sources get discarded when vector
tests downgrade to compile-only.


for  gcc/ChangeLog

* doc/sourcebuild.texi (dg-additional-sources): Add linkonly.

for  gcc/testsuite/ChangeLog

* g++.dg/vect/pr95401.cc: Add linkonly to dg-additional-sources.
* lib/gcc-defs (additional_sources_omit_on_compile): New.
(dg-additional-sources): Add to it on linkonly.
(dg-additional-files-options): Omit select sources on compile.

Diff:
---
 gcc/doc/sourcebuild.texi |  9 +
 gcc/testsuite/g++.dg/vect/pr95401.cc |  2 +-
 gcc/testsuite/lib/gcc-defs.exp   | 35 ---
 3 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index e997dbec3334..08c178db674c 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1320,15 +1320,16 @@ to @var{var_value} before execution of the program 
created by the test.
 Specify additional files, other than source files, that must be copied
 to the system where the compiler runs.
 
-@item @{ dg-additional-sources "@var{filelist}" [@{ target @var{selector} @}] 
@}
+@item @{ dg-additional-sources "@var{filelist}" [@{ \[linkonly\] \[target 
@var{selector}\] @}] @}
 Specify additional source files to appear in the compile line
 following the main test file.
 If the directive includes the optional @samp{@{ @var{selector} @}}
 then the additional sources are only added if the target system
 matches the @var{selector}.
-Additional sources are generally used only in @samp{link} and @samp{run}
-tests; they are reported as unsupported and discarded in other kinds of
-tests that direct the compiler to output to a single file.
+If @samp{linkonly} is specified, additional sources are used only in
+@samp{link} and @samp{run} tests; they are reported as unsupported and
+discarded in other kinds of tests that direct the compiler to output to
+a single file.
 @end table
 
 @subsubsection Add checks at the end of a test
diff --git a/gcc/testsuite/g++.dg/vect/pr95401.cc 
b/gcc/testsuite/g++.dg/vect/pr95401.cc
index 6a56dab09572..8b1be4f24252 100644
--- a/gcc/testsuite/g++.dg/vect/pr95401.cc
+++ b/gcc/testsuite/g++.dg/vect/pr95401.cc
@@ -1,5 +1,5 @@
 // { dg-additional-options "-mavx2 -O3" { target avx2_runtime } }
-// { dg-additional-sources pr95401a.cc }
+// { dg-additional-sources pr95401a.cc linkonly }
 
 extern int var_9;
 extern unsigned var_14;
diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp
index cdca4c254d6e..c6ec490f0092 100644
--- a/gcc/testsuite/lib/gcc-defs.exp
+++ b/gcc/testsuite/lib/gcc-defs.exp
@@ -303,18 +303,26 @@ proc dg-additional-options { args } {
 # main source file.
 
 set additional_sources ""
+set additional_sources_omit_on_compile ""
 set additional_sources_used ""
 
 proc dg-additional-sources { args } {
 global additional_sources
+global additional_sources_omit_on_compile
 
 if { [llength $args] > 3 } {
error "[lindex $args 0]: too many arguments"
return
 }
 
-if { [llength $args] >= 3 } {
-   switch [dg-process-target [lindex $args 2]] {
+set target [lindex $args 2]
+if { [llength $args] >= 3 && [lindex $target 0] == "linkonly" } {
+   append additional_sources_omit_on_compile " [lindex $args 1]"
+   set target [lreplace $target 0 1]
+}
+
+if { [llength $args] >= 3 && $target != ""} {
+   switch [dg-process-target $target] {
"S" { append additional_sources " [lindex $args 1]" }
"N" { }
"F" { error "[lindex $args 0]: `xfail' not allowed here" }
@@ -407,16 +415,29 @@ proc dg-additional-files-options { options source dest 
type } {
 gcc_adjust_linker_flags
 
 global additional_sources
+global additional_sources_omit_on_compile
 global additional_sources_used
 global additional_files
 set to_download [list]
-if { $additional_sources == "" } then {
-} elseif { $type != "executable" && $dest != "" } then {
+if { $additional_sources_omit_on_compile != "" \
+&& $additional_sources != "" \
+&& $type != "executable" && $dest != "" } then {
+   set linkonly ""
foreach s $additional_sources {
-   unsupported "$s: additional-source 

[gcc(refs/users/aoliva/heads/testme)] map packed field type to unpacked for debug info

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:4f96af24fbfa3b7d6d43149c01e7d9a0a5b3e248

commit 4f96af24fbfa3b7d6d43149c01e7d9a0a5b3e248
Author: Alexandre Oliva 
Date:   Tue Jun 11 20:30:30 2024 -0300

map packed field type to unpacked for debug info

We create a distinct type for each field in a packed record with a
gnu_size, but there is no distinct debug information for them.  Use
the same unpacked type for debug information.


for  gcc/ada/ChangeLog

* gcc-interface/decl.cc (gnat_to_gnu_field): Use unpacked type
as the debug type for packed fields.

for  gcc/testsuite/ChangeLog

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/decl.cc   | 4 
 gcc/testsuite/gnat.dg/bias1.adb | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 8b72c96c4396..e97ff64a4805 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7786,6 +7786,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
   /* If a size is specified, adjust the field's type to it.  */
   if (gnu_size)
 {
+  tree debug_field_type = gnu_field_type;
   tree orig_field_type;
 
   /* If the field's type is justified modular, we would need to remove
@@ -7844,6 +7845,9 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
  && !DECL_P (TYPE_NAME (gnu_field_type)))
create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, true,
  debug_info_p, gnat_field);
+
+  if (debug_info_p && gnu_field_type != debug_field_type)
+   SET_TYPE_DEBUG_TYPE (gnu_field_type, debug_field_type);
 }
 
   /* Otherwise (or if there was an error), don't specify a position.  */
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index 016a159b692d..d9a00a1aa458 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,6 +1,7 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
+--  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -31,4 +32,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
\ No newline at end of file
+end Bias1;


[gcc/aoliva/heads/testme] (2 commits) [testsuite] add linkonly to dg-additional-sources [PR115295

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 606e815b8427... [testsuite] add linkonly to dg-additional-sources [PR115295

It previously pointed to:

 d0e0c26b2a32... [testsuite] add linkonly to dg-additional-sources [PR115295

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  d0e0c26... [testsuite] add linkonly to dg-additional-sources [PR115295
  e8eff7b... map packed field type to unpacked for debug info


Summary of changes (added commits):
---

  606e815... [testsuite] add linkonly to dg-additional-sources [PR115295
  4f96af2... map packed field type to unpacked for debug info


[gcc(refs/users/aoliva/heads/testme)] [testsuite] add linkonly to dg-additional-sources [PR115295]

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:d0e0c26b2a3211ca0e1d945b4745c580d8f65f33

commit d0e0c26b2a3211ca0e1d945b4745c580d8f65f33
Author: Alexandre Oliva 
Date:   Tue Jun 11 21:44:55 2024 -0300

[testsuite] add linkonly to dg-additional-sources [PR115295]

Diff:
---
 gcc/doc/sourcebuild.texi |  9 +
 gcc/testsuite/g++.dg/vect/pr95401.cc |  2 +-
 gcc/testsuite/lib/gcc-defs.exp   | 36 
 3 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index e997dbec3334..08c178db674c 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1320,15 +1320,16 @@ to @var{var_value} before execution of the program 
created by the test.
 Specify additional files, other than source files, that must be copied
 to the system where the compiler runs.
 
-@item @{ dg-additional-sources "@var{filelist}" [@{ target @var{selector} @}] 
@}
+@item @{ dg-additional-sources "@var{filelist}" [@{ \[linkonly\] \[target 
@var{selector}\] @}] @}
 Specify additional source files to appear in the compile line
 following the main test file.
 If the directive includes the optional @samp{@{ @var{selector} @}}
 then the additional sources are only added if the target system
 matches the @var{selector}.
-Additional sources are generally used only in @samp{link} and @samp{run}
-tests; they are reported as unsupported and discarded in other kinds of
-tests that direct the compiler to output to a single file.
+If @samp{linkonly} is specified, additional sources are used only in
+@samp{link} and @samp{run} tests; they are reported as unsupported and
+discarded in other kinds of tests that direct the compiler to output to
+a single file.
 @end table
 
 @subsubsection Add checks at the end of a test
diff --git a/gcc/testsuite/g++.dg/vect/pr95401.cc 
b/gcc/testsuite/g++.dg/vect/pr95401.cc
index 6a56dab09572..8b1be4f24252 100644
--- a/gcc/testsuite/g++.dg/vect/pr95401.cc
+++ b/gcc/testsuite/g++.dg/vect/pr95401.cc
@@ -1,5 +1,5 @@
 // { dg-additional-options "-mavx2 -O3" { target avx2_runtime } }
-// { dg-additional-sources pr95401a.cc }
+// { dg-additional-sources pr95401a.cc linkonly }
 
 extern int var_9;
 extern unsigned var_14;
diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp
index cdca4c254d6e..324a90981e43 100644
--- a/gcc/testsuite/lib/gcc-defs.exp
+++ b/gcc/testsuite/lib/gcc-defs.exp
@@ -303,6 +303,7 @@ proc dg-additional-options { args } {
 # main source file.
 
 set additional_sources ""
+set additional_sources_omit_on_compile ""
 set additional_sources_used ""
 
 proc dg-additional-sources { args } {
@@ -313,8 +314,14 @@ proc dg-additional-sources { args } {
return
 }
 
-if { [llength $args] >= 3 } {
-   switch [dg-process-target [lindex $args 2]] {
+set target [lindex $args 2]
+if { [llength $args] >= 3 && [lindex $target 0] == "linkonly" } {
+   append additional_sources_omit_on_compile " [lindex $args 1]"
+   set target [lreplace $target 0 1]
+}
+
+if { [llength $args] >= 3 && $target != ""} {
+   switch [dg-process-target $target] {
"S" { append additional_sources " [lindex $args 1]" }
"N" { }
"F" { error "[lindex $args 0]: `xfail' not allowed here" }
@@ -407,17 +414,30 @@ proc dg-additional-files-options { options source dest 
type } {
 gcc_adjust_linker_flags
 
 global additional_sources
+global additional_sources_omit_on_compile
 global additional_sources_used
 global additional_files
 set to_download [list]
 if { $additional_sources == "" } then {
-} elseif { $type != "executable" && $dest != "" } then {
-   foreach s $additional_sources {
-   unsupported "$s: additional-source will not be used to build $dest"
-   }
-   set additional_sources_used ""
-   set additional_sources ""
 } else {
+   
+   if { $type != "executable" && $dest != "" && \
+$additional_sources_omit_on_compile != "" } then {
+   set linkonly ""
+   foreach s $additional_sources {
+   foreach s2 $additional_sources_omit_on_compile {
+   if { $s == $s2 } {
+   unsupported "$s: additional-source will not be used to 
build $dest"
+   set s ""
+   break
+   }
+   }
+   if { $s != "" } {
+   append linkonly " $s"
+   }
+   }
+   set additional_sources "$linkonly"
+   }
if [is_remote host] {
lappend options "additional_flags=$additional_sources"
}


[gcc(refs/users/aoliva/heads/testme)] map packed field type to unpacked for debug info

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:e8eff7b6ed77dc74bfb4c042d7acdb3963848409

commit e8eff7b6ed77dc74bfb4c042d7acdb3963848409
Author: Alexandre Oliva 
Date:   Tue Jun 11 20:30:30 2024 -0300

map packed field type to unpacked for debug info

We create a distinct type for each field in a packed record with a
gnu_size, but there is no distinct debug information for them.  Use
the same unpacked type for debug information.


for  gcc/ada/ChangeLog

* gcc-interfacedecl.cc (gnat_to_gnu_field): Use unpacked type
as the debug type for packed fields.

for  gcc/testsuite

* gnat.dg/bias1.adb: Count occurrences of -7.*DW_AT_GNU_bias.

Diff:
---
 gcc/ada/gcc-interface/decl.cc   | 4 
 gcc/testsuite/gnat.dg/bias1.adb | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 8b72c96c4396..e97ff64a4805 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7786,6 +7786,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
   /* If a size is specified, adjust the field's type to it.  */
   if (gnu_size)
 {
+  tree debug_field_type = gnu_field_type;
   tree orig_field_type;
 
   /* If the field's type is justified modular, we would need to remove
@@ -7844,6 +7845,9 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree 
gnu_record_type, int packed,
  && !DECL_P (TYPE_NAME (gnu_field_type)))
create_type_decl (TYPE_NAME (gnu_field_type), gnu_field_type, true,
  debug_info_p, gnat_field);
+
+  if (debug_info_p && gnu_field_type != debug_field_type)
+   SET_TYPE_DEBUG_TYPE (gnu_field_type, debug_field_type);
 }
 
   /* Otherwise (or if there was an error), don't specify a position.  */
diff --git a/gcc/testsuite/gnat.dg/bias1.adb b/gcc/testsuite/gnat.dg/bias1.adb
index 016a159b692d..d9a00a1aa458 100644
--- a/gcc/testsuite/gnat.dg/bias1.adb
+++ b/gcc/testsuite/gnat.dg/bias1.adb
@@ -1,6 +1,7 @@
 --  { dg-do compile }
 --  { dg-options "-cargs -g -dA -gnatws -fgnat-encodings=gdb -margs" }
 --  { dg-final { scan-assembler "DW_AT_GNU_bias" } }
+--  { dg-final { scan-assembler-times "-7.*DW_AT_GNU_bias" 1 } }
 
 procedure Bias1 is
type Small is range -7 .. -4;
@@ -31,4 +32,4 @@ procedure Bias1 is
 
 begin
null;
-end Bias1;
\ No newline at end of file
+end Bias1;


[gcc/aoliva/heads/testme] (13 commits) map packed field type to unpacked for debug info

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 e8eff7b6ed77... map packed field type to unpacked for debug info

It previously pointed to:

 c3e23e85d8a3... [libstdc++] drop workaround for clang<=7

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  c3e23e8... [libstdc++] drop workaround for clang<=7
  81cb861... [testsuite] [arm] test board cflags in multilib.exp


Summary of changes (added commits):
---

  e8eff7b... map packed field type to unpacked for debug info
  bed2675... [libstdc++] [testsuite] require cmath for c++23 cmath tests
  1c784e7... [libstdc++] [testsuite] xfail double-prec from_chars for fl
  b6a9deb... [libstdc++] drop workaround for clang<=7 (*)
  dd6f942... Fix fold-left reduction vectorization with multiple stmt co (*)
  9499756... libstdc++: Optimize std::to_address (*)
  e4f1c1b... fixincludes: bypass some fixes for recent darwin headers (*)
  c319075... Add finalizer creation to array constructor for functions o (*)
  a47b1aa... bitint: Fix up lower_addsub_overflow [PR115352] (*)
  9fff0be... go: Fix gccgo -v on Solaris with ld (*)
  9ab90fc... testsuite: go: Require split-stack support for go.test/test (*)
  51046e4... Fix returned type to be allocatable for user-functions. (*)
  3472b57... enable adjustment of return_pc debug attrs (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testme' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc/aoliva/heads/testbase] (9 commits) Fix fold-left reduction vectorization with multiple stmt co

2024-06-11 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 dd6f942c2665... Fix fold-left reduction vectorization with multiple stmt co

It previously pointed to:

 b24f2954dbc1... Add additional option --param max-completely-peeled-insns=2

Diff:

Summary of changes (added commits):
---

  dd6f942... Fix fold-left reduction vectorization with multiple stmt co (*)
  9499756... libstdc++: Optimize std::to_address (*)
  e4f1c1b... fixincludes: bypass some fixes for recent darwin headers (*)
  c319075... Add finalizer creation to array constructor for functions o (*)
  a47b1aa... bitint: Fix up lower_addsub_overflow [PR115352] (*)
  9fff0be... go: Fix gccgo -v on Solaris with ld (*)
  9ab90fc... testsuite: go: Require split-stack support for go.test/test (*)
  51046e4... Fix returned type to be allocatable for user-functions. (*)
  3472b57... enable adjustment of return_pc debug attrs (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testbase' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc r15-1089] enable adjustment of return_pc debug attrs

2024-06-06 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:3472b5749df53b91bcb00a3e82cc85ef1f3b17ce

commit r15-1089-g3472b5749df53b91bcb00a3e82cc85ef1f3b17ce
Author: Alexandre Oliva 
Date:   Wed May 29 02:52:07 2024 -0300

enable adjustment of return_pc debug attrs

This patch introduces infrastructure for targets to add an offset to
the label issued after the call_insn to set the call_return_pc
attribute.  This will be used on rs6000, that sometimes issues another
instruction after the call proper as part of a call insn.


for  gcc/ChangeLog

* target.def (call_offset_return_label): New hook.
* doc/tm.texi.in (TARGET_CALL_OFFSET_RETURN_LABEL): Add
placeholder.
* doc/tm.texi: Rebuild.
* dwarf2out.cc (struct call_arg_loc_node): Record call_insn
instead of call_arg_loc_note.
(add_AT_lbl_id): Add optional offset argument.
(gen_call_site_die): Compute and pass on a return pc offset.
(gen_subprogram_die): Move call_arg_loc_note computation...
(dwarf2out_var_location): ... from here.  Set call_insn.

Diff:
---
 gcc/doc/tm.texi|  7 +++
 gcc/doc/tm.texi.in |  2 ++
 gcc/dwarf2out.cc   | 26 +-
 gcc/target.def |  9 +
 4 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index cd50078227d..8a7aa70d605 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -5557,6 +5557,13 @@ except the last are treated as named.
 You need not define this hook if it always returns @code{false}.
 @end deftypefn
 
+@deftypefn {Target Hook} int TARGET_CALL_OFFSET_RETURN_LABEL (rtx_insn 
*@var{call_insn})
+While generating call-site debug info for a CALL insn, or a SEQUENCE
+insn starting with a CALL, this target hook is invoked to compute the
+offset to be added to the debug label emitted after the call to obtain
+the return address that should be recorded as the return PC.
+@end deftypefn
+
 @deftypefn {Target Hook} void TARGET_START_CALL_ARGS (cumulative_args_t 
@var{complete_args})
 This target hook is invoked while generating RTL for a function call,
 after the argument values have been computed, and after stack arguments
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 058bd56487a..9e0830758ae 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3887,6 +3887,8 @@ These machine description macros help implement varargs:
 
 @hook TARGET_STRICT_ARGUMENT_NAMING
 
+@hook TARGET_CALL_OFFSET_RETURN_LABEL
+
 @hook TARGET_START_CALL_ARGS
 
 @hook TARGET_CALL_ARGS
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 89efa5474d3..f90f7b1cfef 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -3593,7 +3593,7 @@ typedef struct var_loc_list_def var_loc_list;
 
 /* Call argument location list.  */
 struct GTY ((chain_next ("%h.next"))) call_arg_loc_node {
-  rtx GTY (()) call_arg_loc_note;
+  rtx_insn * GTY (()) call_insn;
   const char * GTY (()) label;
   tree GTY (()) block;
   bool tail_call_p;
@@ -3777,7 +3777,8 @@ static void remove_addr_table_entry (addr_table_entry *);
 static void add_AT_addr (dw_die_ref, enum dwarf_attribute, rtx, bool);
 static inline rtx AT_addr (dw_attr_node *);
 static void add_AT_symview (dw_die_ref, enum dwarf_attribute, const char *);
-static void add_AT_lbl_id (dw_die_ref, enum dwarf_attribute, const char *);
+static void add_AT_lbl_id (dw_die_ref, enum dwarf_attribute, const char *,
+  int = 0);
 static void add_AT_lineptr (dw_die_ref, enum dwarf_attribute, const char *);
 static void add_AT_macptr (dw_die_ref, enum dwarf_attribute, const char *);
 static void add_AT_range_list (dw_die_ref, enum dwarf_attribute,
@@ -5353,14 +5354,17 @@ add_AT_symview (dw_die_ref die, enum dwarf_attribute 
attr_kind,
 
 static inline void
 add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind,
-   const char *lbl_id)
+  const char *lbl_id, int offset)
 {
   dw_attr_node attr;
 
   attr.dw_attr = attr_kind;
   attr.dw_attr_val.val_class = dw_val_class_lbl_id;
   attr.dw_attr_val.val_entry = NULL;
-  attr.dw_attr_val.v.val_lbl_id = xstrdup (lbl_id);
+  if (!offset)
+attr.dw_attr_val.v.val_lbl_id = xstrdup (lbl_id);
+  else
+attr.dw_attr_val.v.val_lbl_id = xasprintf ("%s%+i", lbl_id, offset);
   if (dwarf_split_debug_info)
 attr.dw_attr_val.val_entry
 = add_addr_table_entry (attr.dw_attr_val.v.val_lbl_id,
@@ -23547,7 +23551,9 @@ gen_call_site_die (tree decl, dw_die_ref subr_die,
   if (stmt_die == NULL)
 stmt_die = subr_die;
   die = new_die (dwarf_TAG (DW_TAG_call_site), stmt_die, NULL_TREE);
-  add_AT_lbl_id (die, dwarf_AT (DW_AT_call_return_pc), ca_loc->label);
+  add_AT_lbl_id (die, dwarf_AT (DW_AT_call_return_pc),
+ca_loc->label,
+targetm.calls.call_offset_return_label (ca_loc->call_insn));
   if (ca_loc->tail_call_p)
 add_AT_flag (die, dwarf_AT (DW_AT_call_tail_call), 1);
   if 

[gcc(refs/users/aoliva/heads/testme)] [testsuite] [arm] test board cflags in multilib.exp

2024-06-06 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:81cb861f41a46bbc8632cb68878c3334b1c71cf8

commit 81cb861f41a46bbc8632cb68878c3334b1c71cf8
Author: Alexandre Oliva 
Date:   Fri Jun 7 00:27:11 2024 -0300

[testsuite] [arm] test board cflags in multilib.exp

multilib.exp tests for multilib-altering flags in a board's
multilib_flags and skips the test, but if such flags appear in the
board's cflags, with the same distorting effects on tested multilibs,
we fail to skip the test.

Extend the skipping logic to board's cflags as well.


for  gcc/testsuite/ChangeLog

* gcc.target/arm/multilib.exp: Skip based on board cflags too.

Diff:
---
 gcc/testsuite/gcc.target/arm/multilib.exp | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp 
b/gcc/testsuite/gcc.target/arm/multilib.exp
index 4442d5d754b..12c93bc89d2 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -18,13 +18,15 @@ load_lib gcc-dg.exp
 
 dg-init
 
-if { [board_info [target_info name] exists multilib_flags] 
- && [regexp {(-marm|-mthumb|-march=.*|-mcpu=.*|-mfpu=.*|-mfloat=abi=.*)\y} 
[board_info [target_info name] multilib_flags]] } {
+foreach flagsvar {multilib_flags cflags} {
+  if { [board_info [target_info name] exists $flagsvar] 
+ && [regexp {(-marm|-mthumb|-march=.*|-mcpu=.*|-mfpu=.*|-mfloat=abi=.*)\y} 
[board_info [target_info name] $flagsvar]] } {

 # Multilib flags override anything we can apply to a test, so
 # skip if any of the above options are set there.
-verbose "skipping multilib tests due to multilib_flags setting" 1
+verbose "skipping multilib tests due to $flagsvar setting" 1
 return
+  }
 }
 
 # We don't want to run this test multiple times in a parallel make check.


[gcc/aoliva/heads/testme] (167 commits) [libstdc++] drop workaround for clang<=7

2024-06-06 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 c3e23e85d8a... [libstdc++] drop workaround for clang<=7

It previously pointed to:

 1472684e8ba... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  1472684... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c


Summary of changes (added commits):
---

  c3e23e8... [libstdc++] drop workaround for clang<=7
  81cb861... [testsuite] [arm] test board cflags in multilib.exp
  b24f295... Add additional option --param max-completely-peeled-insns=2 (*)
  93f44e1... RISC-V: Add testcases for scalar unsigned SAT_ADD form 5 (*)
  a171aac... RISC-V: Add testcases for scalar unsigned SAT_ADD form 4 (*)
  39dde92... RISC-V: Add testcases for scalar unsigned SAT_ADD form 3 (*)
  0261ed4... RISC-V: Add testcases for scalar unsigned SAT_ADD form 2 (*)
  a737c2b... RISC-V: Add testcases for scalar unsigned SAT_ADD form 1 (*)
  6af18e8... Daily bump. (*)
  e14afbe... Match: Support more form for scalar unsigned SAT_ADD (*)
  d5a3c6d... c: Fix up pointer types to may_alias structures [PR114493] (*)
  230d62a... aarch64: Add vector floating point extend pattern [PR113880 (*)
  30ce9df... modula2: Simplify REAL/LONGREAL/SHORTREAL node creation. (*)
  366d45c... testsuite/i386: Add vector sat_sub testcases [PR112600] (*)
  6e64718... Plugins: Add label-text.h to CPPLIB_H so it will be install (*)
  43530bc... aarch64: Add missing ACLE macro for NEON-SVE Bridge (*)
  2963c76... arm: Fix CASE_VECTOR_SHORTEN_MODE for thumb2. (*)
  c559353... arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR11 (*)
  423522a... libgomp.texi (nvptx): Add missing preposition (*)
  afe85f8... AArch64: correct constraint on Upl early clobber alternativ (*)
  3a4775d... nvptx, libgfortran: Switch out of "minimal" mode (*)
  0d25989... nvptx offloading: 'GOMP_NVPTX_NATIVE_GPU_THREAD_STACK_SIZE' (*)
  a29c585... nvptx, libgcc: Stub unwinding implementation (*)
  5bbe535... nvptx offloading: Global constructor, destructor support, v (*)
  b4e68dd... nvptx: Make 'nvptx_uniform_warp_check' fit for non-full-war (*)
  395ac04... Clean up after newlib "nvptx: In offloading execution, map  (*)
  2d11de3... Vect: Support IFN SAT_SUB for unsigned vector int (*)
  346f33e... lto: Remove random_seed from section name. (*)
  ca43678... lto: Skip flag OPT_fltrans_output_list_. (*)
  037fc4d... RISC-V: Regenerate opt urls. (*)
  0b6cea8... [APX CCMP] Support ccmp for float compare (*)
  23db873... [APX CCMP] Adjust startegy for selecting ccmp candidates (*)
  c989e59... [APX CCMP] Support APX CCMP (*)
  f46d54a... [APX] Adjust target-support check [PR 115341] (*)
  4653b68... Allow single-lane SLP in-order reductions (*)
  2ee41ef... Add double reduction support for SLP vectorization (*)
  202a9c8... Allow single-lane COND_REDUCTION vectorization (*)
  28edeb1... Relax COND_EXPR reduction vectorization SLP restriction (*)
  6a6bab4... libgomp: Mark Loop transformation constructs as implemented (*)
  edd90d6... MIPS: Need COSTS_N_INSNS in mips_insn_cost (*)
  fcfce55... Refine testcase for power10. (*)
  67be156... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c (*)
  961dd0d... Adjust rtx_cost for MEM to enable more simplication (*)
  7876cde... Simplify (AND (ASHIFTRT A imm) mask) to (LSHIFTRT A imm) fo (*)
  10cb333... Daily bump. (*)
  66fa2f1... contrib: Fix spelling and capitalization in header-tools (*)
  ac6fb0f... contrib: header-tools scripts updated to python3 (*)
  03e1a72... check_GNU_style: Use raw strings. (*)
  68b0742... RISC-V: Introduce -mvector-strict-align. (*)
  3eb9f6e... AArch64: enable new predicate tuning for Neoverse cores. (*)
  2de3bbd... AArch64: add new alternative with early clobber to patterns (*)
  35f17c6... AArch64: add new tuning param and attribute for enabling co (*)
  fd48988... AArch64: convert several predicate patterns to new compact  (*)
  804c0f3... openmp: OpenMP loop transformation support (*)
  d7cbcfe... AArch64: Fix cpu features initialization [PR115342] (*)
  acdc9df... testsuite: Improve check-function-bodies (*)
  58ecd2e... darwin: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  37a4800... fortran: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  b36461f... d: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  6fa25aa... ada: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  abe6d39... Internal-fn: Support new IFN SAT_SUB for unsigned scalar in (*)
  9931426... doc: Streamline recommendation of GNU awk (*)
  d5ccc21... Add 'c-c++-common/initpri1{,-lto,-split}-static.c' as inter (*)
  02e43e5... Add 'c-c++-common/initpri1-split.c': 'c-c++-common/initpri1 (*)
  08c7e87... Add C++ testing for 'gcc.dg/initpri1-lto.c': 'c-c++-common/ (*)
  a7d7577... Consolidate similar C/C++ test cases for 'constructor', 'de (*)
  38dd741... Clarify that 'gcc.dg/initpri3.c' is 

[gcc/aoliva/heads/testbase] (165 commits) Add additional option --param max-completely-peeled-insns=2

2024-06-06 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 b24f2954dbc... Add additional option --param max-completely-peeled-insns=2

It previously pointed to:

 ac5c6c90a7f... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra

Diff:

Summary of changes (added commits):
---

  b24f295... Add additional option --param max-completely-peeled-insns=2 (*)
  93f44e1... RISC-V: Add testcases for scalar unsigned SAT_ADD form 5 (*)
  a171aac... RISC-V: Add testcases for scalar unsigned SAT_ADD form 4 (*)
  39dde92... RISC-V: Add testcases for scalar unsigned SAT_ADD form 3 (*)
  0261ed4... RISC-V: Add testcases for scalar unsigned SAT_ADD form 2 (*)
  a737c2b... RISC-V: Add testcases for scalar unsigned SAT_ADD form 1 (*)
  6af18e8... Daily bump. (*)
  e14afbe... Match: Support more form for scalar unsigned SAT_ADD (*)
  d5a3c6d... c: Fix up pointer types to may_alias structures [PR114493] (*)
  230d62a... aarch64: Add vector floating point extend pattern [PR113880 (*)
  30ce9df... modula2: Simplify REAL/LONGREAL/SHORTREAL node creation. (*)
  366d45c... testsuite/i386: Add vector sat_sub testcases [PR112600] (*)
  6e64718... Plugins: Add label-text.h to CPPLIB_H so it will be install (*)
  43530bc... aarch64: Add missing ACLE macro for NEON-SVE Bridge (*)
  2963c76... arm: Fix CASE_VECTOR_SHORTEN_MODE for thumb2. (*)
  c559353... arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR11 (*)
  423522a... libgomp.texi (nvptx): Add missing preposition (*)
  afe85f8... AArch64: correct constraint on Upl early clobber alternativ (*)
  3a4775d... nvptx, libgfortran: Switch out of "minimal" mode (*)
  0d25989... nvptx offloading: 'GOMP_NVPTX_NATIVE_GPU_THREAD_STACK_SIZE' (*)
  a29c585... nvptx, libgcc: Stub unwinding implementation (*)
  5bbe535... nvptx offloading: Global constructor, destructor support, v (*)
  b4e68dd... nvptx: Make 'nvptx_uniform_warp_check' fit for non-full-war (*)
  395ac04... Clean up after newlib "nvptx: In offloading execution, map  (*)
  2d11de3... Vect: Support IFN SAT_SUB for unsigned vector int (*)
  346f33e... lto: Remove random_seed from section name. (*)
  ca43678... lto: Skip flag OPT_fltrans_output_list_. (*)
  037fc4d... RISC-V: Regenerate opt urls. (*)
  0b6cea8... [APX CCMP] Support ccmp for float compare (*)
  23db873... [APX CCMP] Adjust startegy for selecting ccmp candidates (*)
  c989e59... [APX CCMP] Support APX CCMP (*)
  f46d54a... [APX] Adjust target-support check [PR 115341] (*)
  4653b68... Allow single-lane SLP in-order reductions (*)
  2ee41ef... Add double reduction support for SLP vectorization (*)
  202a9c8... Allow single-lane COND_REDUCTION vectorization (*)
  28edeb1... Relax COND_EXPR reduction vectorization SLP restriction (*)
  6a6bab4... libgomp: Mark Loop transformation constructs as implemented (*)
  edd90d6... MIPS: Need COSTS_N_INSNS in mips_insn_cost (*)
  fcfce55... Refine testcase for power10. (*)
  67be156... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c (*)
  961dd0d... Adjust rtx_cost for MEM to enable more simplication (*)
  7876cde... Simplify (AND (ASHIFTRT A imm) mask) to (LSHIFTRT A imm) fo (*)
  10cb333... Daily bump. (*)
  66fa2f1... contrib: Fix spelling and capitalization in header-tools (*)
  ac6fb0f... contrib: header-tools scripts updated to python3 (*)
  03e1a72... check_GNU_style: Use raw strings. (*)
  68b0742... RISC-V: Introduce -mvector-strict-align. (*)
  3eb9f6e... AArch64: enable new predicate tuning for Neoverse cores. (*)
  2de3bbd... AArch64: add new alternative with early clobber to patterns (*)
  35f17c6... AArch64: add new tuning param and attribute for enabling co (*)
  fd48988... AArch64: convert several predicate patterns to new compact  (*)
  804c0f3... openmp: OpenMP loop transformation support (*)
  d7cbcfe... AArch64: Fix cpu features initialization [PR115342] (*)
  acdc9df... testsuite: Improve check-function-bodies (*)
  58ecd2e... darwin: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  37a4800... fortran: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE (*)
  b36461f... d: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  6fa25aa... ada: Replace use of LONG_DOUBLE_TYPE_SIZE (*)
  abe6d39... Internal-fn: Support new IFN SAT_SUB for unsigned scalar in (*)
  9931426... doc: Streamline recommendation of GNU awk (*)
  d5ccc21... Add 'c-c++-common/initpri1{,-lto,-split}-static.c' as inter (*)
  02e43e5... Add 'c-c++-common/initpri1-split.c': 'c-c++-common/initpri1 (*)
  08c7e87... Add C++ testing for 'gcc.dg/initpri1-lto.c': 'c-c++-common/ (*)
  a7d7577... Consolidate similar C/C++ test cases for 'constructor', 'de (*)
  38dd741... Clarify that 'gcc.dg/initpri3.c' is a LTO variant of 'gcc.d (*)
  35e453d... libstdc++: Update gcc.gnu.org links in FAQ to https (*)
  b05288d... Don't simplify NAN/INF or out-of-range constant for FIX/UNS (*)
  4638e50... RISC-V: Add Zfbfmin extension (*)
  904fbe9... Daily bump. (*)
  126ccf8... c++: Add testcase for PR103338 (*)
  7f21aee... 

[gcc(refs/users/aoliva/heads/testme)] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:1472684e8baaf4137c27fc725e6f2b1e852b

commit 1472684e8baaf4137c27fc725e6f2b1e852b
Author: Alexandre Oliva 
Date:   Fri May 31 09:10:55 2024 -0300

[libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

A proprietary embedded operating system that uses clang as its primary
compiler ships headers that require __clang__ to be defined.  Defining
that macro causes libstdc++ to adopt workarounds that work for clang
but that break for GCC.

So, introduce a _GLIBCXX_CLANG macro, and a convention to test for it
rather than for __clang__, so that a GCC variant that adds -D__clang__
to satisfy system headers can also -D_GLIBCXX_CLANG=0 to avoid
workarounds that are not meant for GCC.

I've left fast_float and ryu files alone, their tests for __clang__
don't seem to be harmful for GCC, they don't include bits/c++config,
and patching such third-party files would just make trouble for
updating them without visible benefit.


for  libstdc++-v3/ChangeLog

* include/bits/c++config (_GLIBCXX_CLANG): Define or undefine.
* include/bits/locale_facets_nonio.tcc: Test for it.
* include/bits/stl_bvector.h: Likewise.
* include/c_compatibility/stdatomic.h: Likewise.
* include/experimental/bits/simd.h: Likewise.
* include/experimental/bits/simd_builtin.h: Likewise.
* include/experimental/bits/simd_detail.h: Likewise.
* include/experimental/bits/simd_x86.h: Likewise.
* include/experimental/simd: Likewise.
* include/std/complex: Likewise.
* include/std/ranges: Likewise.
* include/std/variant: Likewise.
* include/pstl/pstl_config.h: Likewise, when defined(__GLIBCXX__).

Diff:
---
 libstdc++-v3/include/bits/c++config   | 13 -
 libstdc++-v3/include/bits/locale_facets_nonio.tcc |  2 +-
 libstdc++-v3/include/bits/stl_bvector.h   |  2 +-
 libstdc++-v3/include/c_compatibility/stdatomic.h  |  2 +-
 libstdc++-v3/include/experimental/bits/simd.h | 14 +++---
 libstdc++-v3/include/experimental/bits/simd_builtin.h |  4 ++--
 libstdc++-v3/include/experimental/bits/simd_detail.h  |  8 
 libstdc++-v3/include/experimental/bits/simd_x86.h | 12 ++--
 libstdc++-v3/include/experimental/simd|  2 +-
 libstdc++-v3/include/pstl/pstl_config.h   |  4 ++--
 libstdc++-v3/include/std/complex  |  4 ++--
 libstdc++-v3/include/std/ranges   |  8 
 libstdc++-v3/include/std/variant  |  2 +-
 13 files changed, 44 insertions(+), 33 deletions(-)

diff --git a/libstdc++-v3/include/bits/c++config 
b/libstdc++-v3/include/bits/c++config
index b57e3f338e9..6dca2d9467a 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -481,9 +481,20 @@ _GLIBCXX_END_NAMESPACE_VERSION
 // Define if compatibility should be provided for -mlong-double-64.
 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
 
+// Use an alternate macro to test for clang, so as to provide an easy
+// workaround for systems (such as vxworks) whose headers require
+// __clang__ to be defined, even when compiling with GCC.
+#if !defined _GLIBCXX_CLANG && defined __clang__
+# define _GLIBCXX_CLANG __clang__
+// Turn -D_GLIBCXX_CLANG=0 into -U_GLIBCXX_CLANG, so that
+// _GLIBCXX_CLANG can be tested as defined, just like __clang__.
+#elif !_GLIBCXX_CLANG
+# undef _GLIBCXX_CLANG
+#endif
+
 // Define if compatibility should be provided for alternative 128-bit long
 // double formats. Not possible for Clang until __ibm128 is supported.
-#ifndef __clang__
+#ifndef _GLIBCXX_CLANG
 #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
 #endif
 
diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc 
b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
index 8f67be5a614..72136f42f08 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
   ctype<_CharT> const& __ctype = use_facet >(__loc);
   __err = ios_base::goodbit;
   bool __use_state = false;
-#if __GNUC__ >= 5 && !defined(__clang__)
+#if __GNUC__ >= 5 && !defined(_GLIBCXX_CLANG)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wpmf-conversions"
   // Nasty hack.  The C++ standard mandates that get invokes the do_get
diff --git a/libstdc++-v3/include/bits/stl_bvector.h 
b/libstdc++-v3/include/bits/stl_bvector.h
index d567e26f4e4..52153cadf8f 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 void
 _M_assume_normalized() const
 {
-#if __has_attribute(__assume__) && !defined(__clang__)
+#if __has_attribute(__assume__) && 

[gcc/aoliva/heads/testme] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

2024-05-31 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 1472684e8ba... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

It previously pointed to:

 68673b6784a... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  68673b6... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c


Summary of changes (added commits):
---

  1472684... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c


[gcc(refs/users/aoliva/heads/testme)] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:68673b6784aa74e7209e8d54c35124799c0c8fc4

commit 68673b6784aa74e7209e8d54c35124799c0c8fc4
Author: Alexandre Oliva 
Date:   Fri May 31 09:10:55 2024 -0300

[libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

A proprietary embedded operating system that uses clang as its primary
compiler ships headers that require __clang__ to be defined.  Defining
that macro causes libstdc++ to adopt workarounds that work for clang
but that break for GCC.

So, introduce a _GLIBCXX_CLANG macro, and a convention to test for it
rather than for __clang__, so that a GCC variant that adds -D__clang__
to satisfy system headers can also -D_GLIBCXX_CLANG=0 to avoid
workarounds that are not meant for GCC.

I've left fast_float and ryu files alone, their tests for __clang__
don't seem to be harmful for GCC, they don't include bits/c++config,
and patching such third-party files would just make trouble for
updating them without visible benefit.


for  libstdc++-v3/ChangeLog

* include/bits/c++config (_GLIBCXX_CLANG): Define or undefine.
* include/bits/locale_facets_nonio.tcc: Test for it.
* include/bits/stl_bvector.h: Likewise.
* include/c_compatibility/stdatomic.h: Likewise.
* include/experimental/bits/simd.h: Likewise.
* include/experimental/bits/simd_builtin.h: Likewise.
* include/experimental/bits/simd_detail.h: Likewise.
* include/experimental/bits/simd_x86.h: Likewise.
* include/experimental/simd: Likewise.
* include/std/complex: Likewise.
* include/std/ranges: Likewise.
* include/std/variant: Likewise.
* include/pstl/pstl_config.h: Likewise, when defined(__GLIBCXX__).

Diff:
---
 libstdc++-v3/include/bits/c++config   | 13 -
 libstdc++-v3/include/bits/locale_facets_nonio.tcc |  2 +-
 libstdc++-v3/include/bits/stl_bvector.h   |  2 +-
 libstdc++-v3/include/c_compatibility/stdatomic.h  |  2 +-
 libstdc++-v3/include/experimental/bits/simd.h | 14 +++---
 libstdc++-v3/include/experimental/bits/simd_builtin.h |  4 ++--
 libstdc++-v3/include/experimental/bits/simd_detail.h  |  8 
 libstdc++-v3/include/experimental/bits/simd_x86.h | 12 ++--
 libstdc++-v3/include/experimental/simd|  2 +-
 libstdc++-v3/include/pstl/pstl_config.h   |  4 ++--
 libstdc++-v3/include/std/complex  |  4 ++--
 libstdc++-v3/include/std/ranges   |  8 
 libstdc++-v3/include/std/variant  |  2 +-
 13 files changed, 44 insertions(+), 33 deletions(-)

diff --git a/libstdc++-v3/include/bits/c++config 
b/libstdc++-v3/include/bits/c++config
index b57e3f338e9..6dca2d9467a 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -481,9 +481,20 @@ _GLIBCXX_END_NAMESPACE_VERSION
 // Define if compatibility should be provided for -mlong-double-64.
 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
 
+// Use an alternate macro to test for clang, so as to provide an easy
+// workaround for systems (such as vxworks) whose headers require
+// __clang__ to be defined, even when compiling with GCC.
+#if !defined _GLIBCXX_CLANG && defined __clang__
+# define _GLIBCXX_CLANG __clang__
+// Turn -D_GLIBCXX_CLANG=0 into -U_GLIBCXX_CLANG, so that
+// _GLIBCXX_CLANG can be tested as defined, just like __clang__.
+#elif !_GLIBCXX_CLANG
+# undef _GLIBCXX_CLANG
+#endif
+
 // Define if compatibility should be provided for alternative 128-bit long
 // double formats. Not possible for Clang until __ibm128 is supported.
-#ifndef __clang__
+#ifndef _GLIBCXX_CLANG
 #undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
 #endif
 
diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc 
b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
index 8f67be5a614..72136f42f08 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -1465,7 +1465,7 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
   ctype<_CharT> const& __ctype = use_facet >(__loc);
   __err = ios_base::goodbit;
   bool __use_state = false;
-#if __GNUC__ >= 5 && !defined(__clang__)
+#if __GNUC__ >= 5 && !defined(_GLIBCXX_CLANG)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wpmf-conversions"
   // Nasty hack.  The C++ standard mandates that get invokes the do_get
diff --git a/libstdc++-v3/include/bits/stl_bvector.h 
b/libstdc++-v3/include/bits/stl_bvector.h
index d567e26f4e4..52153cadf8f 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 void
 _M_assume_normalized() const
 {
-#if __has_attribute(__assume__) && !defined(__clang__)
+#if __has_attribute(__assume__) && 

[gcc/aoliva/heads/testme] (36 commits) [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

2024-05-31 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testme' was updated to point to:

 68673b6784a... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c

It previously pointed to:

 ca809ee3fbe... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra

Diff:

!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
---

  ca809ee... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra
  0276651... [libstdc++-v3] [rtems] enable filesystem support
  1c34040... [tree-prof] skip if errors were seen [PR113681]
  1b22d42... [testsuite] [arm] add effective target and options for pacb
  d34a3eb... add explicit ABI and align options to pr88233.c
  0bb10f1... [rs6000] adjust return_pc debug attrs
  99047b7... enable adjustment of return_pc debug attrs


Summary of changes (added commits):
---

  68673b6... [libstdc++] add _GLIBCXX_CLANG to workaround predefined __c
  ac5c6c9... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra (*)
  1d71818... [testsuite] conditionalize dg-additional-sources on target  (*)
  5955c18... [libstdc++-v3] [rtems] enable filesystem support (*)
  b6c6d5a... Support vcond_mask_qiqi and friends. (*)
  ef27b91... Don't reduce estimated unrolled size for innermost loop. (*)
  bdc264a... [testsuite] conditionalize dg-additional-sources on target  (*)
  c9842f9... tree-ssa-pre.c/115214(ICE in find_or_generate_expression, a (*)
  c68bd7e... Revert "resource.cc: Replace calls to find_basic_block with (*)
  afe48a4... Revert "resource.cc (mark_target_live_regs): Remove check f (*)
  c31a9d3... Revert "resource.cc: Remove redundant conditionals" (*)
  d815d9a... Daily bump. (*)
  86b98d9... C23: fix aliasing for structures/unions with incomplete typ (*)
  915440e... MIPS16: Mark $2/$3 as clobbered if GP is used (*)
  9a92e5e... MIPS/testsuite: Fix bseli.b fail in msa-builtins.c (*)
  d1a1f7e... PR modula2/115276 bugfix libgm2 wraptime.InitTM returns NIL (*)
  547143d... match: Add support for `a ^ CST` to bitwise_inverted_equal_ (*)
  0a9154d... Match: Add maybe_bit_not instead of plain matching (*)
  39263ed... aarch64: Split aarch64_combinev16qi before RA [PR115258] (*)
  d22eaec... libstdc++: Use RAII to replace try/catch blocks (*)
  b24b081... Delete a file due to push error (*)
  9c74718... vect: Unify bbs in loop_vec_info and bb_vec_info (*)
  eff0004... c++: pragma target and static init [PR109753] (*)
  3ae02dc... [to-be-committed] [RISC-V] Use pack to handle repeating con (*)
  ff41abd... c++: add module extensions (*)
  18f4779... libgomp: Enable USM for AMD APUs and MI200 devices (*)
  4ccb336... libgomp: Enable USM for some nvptx devices (*)
  19c491d... c-family: add hints for strerror (*)
  f46eaad... tree-optimization/115252 - enhance peeling for gaps avoidan (*)
  1065a7d... tree-optimization/114435 - pcom left around copies confusin (*)
  9c6e75a... Fix link failure of GNAT tools on 32-bit SPARC/Linux (*)
  499d001... i386: Fix ix86_option override after change [PR 113719] (*)
  58b8c87... c++: canonicity of fn types w/ instantiated eh specs [PR115 (*)
  2f97d98... Fix memory leak. (*)
  a99ebb8... libstdc++: Build libbacktrace and 19_diagnostics/stacktrace (*)
  241a6cc... libstdc++: Avoid MMX return types from __builtin_shufflevec (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testme' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc/aoliva/heads/testbase] (35 commits) [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra

2024-05-31 Thread Alexandre Oliva via Gcc-cvs
The branch 'aoliva/heads/testbase' was updated to point to:

 ac5c6c90a7f... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra

It previously pointed to:

 b644126237a... Align tight loop without considering max skipping bytes

Diff:

Summary of changes (added commits):
---

  ac5c6c9... [testsuite] [powerpc] adjust -m32 counts for fold-vec-extra (*)
  1d71818... [testsuite] conditionalize dg-additional-sources on target  (*)
  5955c18... [libstdc++-v3] [rtems] enable filesystem support (*)
  b6c6d5a... Support vcond_mask_qiqi and friends. (*)
  ef27b91... Don't reduce estimated unrolled size for innermost loop. (*)
  bdc264a... [testsuite] conditionalize dg-additional-sources on target  (*)
  c9842f9... tree-ssa-pre.c/115214(ICE in find_or_generate_expression, a (*)
  c68bd7e... Revert "resource.cc: Replace calls to find_basic_block with (*)
  afe48a4... Revert "resource.cc (mark_target_live_regs): Remove check f (*)
  c31a9d3... Revert "resource.cc: Remove redundant conditionals" (*)
  d815d9a... Daily bump. (*)
  86b98d9... C23: fix aliasing for structures/unions with incomplete typ (*)
  915440e... MIPS16: Mark $2/$3 as clobbered if GP is used (*)
  9a92e5e... MIPS/testsuite: Fix bseli.b fail in msa-builtins.c (*)
  d1a1f7e... PR modula2/115276 bugfix libgm2 wraptime.InitTM returns NIL (*)
  547143d... match: Add support for `a ^ CST` to bitwise_inverted_equal_ (*)
  0a9154d... Match: Add maybe_bit_not instead of plain matching (*)
  39263ed... aarch64: Split aarch64_combinev16qi before RA [PR115258] (*)
  d22eaec... libstdc++: Use RAII to replace try/catch blocks (*)
  b24b081... Delete a file due to push error (*)
  9c74718... vect: Unify bbs in loop_vec_info and bb_vec_info (*)
  eff0004... c++: pragma target and static init [PR109753] (*)
  3ae02dc... [to-be-committed] [RISC-V] Use pack to handle repeating con (*)
  ff41abd... c++: add module extensions (*)
  18f4779... libgomp: Enable USM for AMD APUs and MI200 devices (*)
  4ccb336... libgomp: Enable USM for some nvptx devices (*)
  19c491d... c-family: add hints for strerror (*)
  f46eaad... tree-optimization/115252 - enhance peeling for gaps avoidan (*)
  1065a7d... tree-optimization/114435 - pcom left around copies confusin (*)
  9c6e75a... Fix link failure of GNAT tools on 32-bit SPARC/Linux (*)
  499d001... i386: Fix ix86_option override after change [PR 113719] (*)
  58b8c87... c++: canonicity of fn types w/ instantiated eh specs [PR115 (*)
  2f97d98... Fix memory leak. (*)
  a99ebb8... libstdc++: Build libbacktrace and 19_diagnostics/stacktrace (*)
  241a6cc... libstdc++: Avoid MMX return types from __builtin_shufflevec (*)

(*) This commit already exists in another branch.
Because the reference `refs/users/aoliva/heads/testbase' matches
your hooks.email-new-commits-only configuration,
no separate email is sent for this commit.


[gcc r15-923] [testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

2024-05-30 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:ac5c6c90a7f1f432fe19bc058d70b08967c25e3e

commit r15-923-gac5c6c90a7f1f432fe19bc058d70b08967c25e3e
Author: Alexandre Oliva 
Date:   Wed May 29 02:52:18 2024 -0300

[testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

Codegen changes caused add instruction count mismatches on
ppc-*-linux-gnu and other 32-bit ppc targets.  At some point the
expected counts were adjusted for lp64, but ilp32 differences
remained, and published test results confirm it.


for  gcc/testsuite/ChangeLog

PR testsuite/101169
* gcc.target/powerpc/fold-vec-extract-double.p7.c: Adjust addi
counts for ilp32.
* gcc.target/powerpc/fold-vec-extract-float.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-float.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p7.c | 5 ++---
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p7.c  | 5 ++---
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p8.c  | 3 +--
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p7.c| 3 +--
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p8.c| 3 +--
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p7.c  | 3 +--
 gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p8.c  | 3 +--
 7 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p7.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p7.c
index 3cae644b90b..e69d9253e2d 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p7.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-double.p7.c
@@ -13,12 +13,11 @@
 /* { dg-final { scan-assembler-times {\mxxpermdi\M} 1 } } */
 /* { dg-final { scan-assembler-times {\mli\M} 1 } } */
 /* -m32 target has an 'add' in place of one of the 'addi'. */
-/* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 2 { target lp64 } } } 
*/
-/* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 3 { target ilp32 } } } 
*/
+/* { dg-final { scan-assembler-times {\maddi?\M} 2 } } */
 /* -m32 target has a rlwinm in place of a rldic .  */
 /* { dg-final { scan-assembler-times {\mrldic\M|\mrlwinm\M} 1 } } */
 /* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 } } */
-/* { dg-final { scan-assembler-times {\mlfdx\M|\mlfd\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlfdx?\M} 1 } } */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p7.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p7.c
index f7c06e96109..ab03cd8adb0 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p7.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p7.c
@@ -12,13 +12,12 @@
 /* { dg-final { scan-assembler-times {\mxscvspdp\M} 1 } } */
 /* { dg-final { scan-assembler-times {\mli\M} 1 } } */
 /* -m32 as an add in place of an addi. */
-/* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 2 { target lp64 } } } 
*/
-/* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 3 { target ilp32 } } } 
*/
+/* { dg-final { scan-assembler-times {\maddi?\M} 2 } } */
 /* { dg-final { scan-assembler-times {\mstxvd2x\M|\mstvx\M|\mstxv\M} 1 } } */
 /* -m32 uses rlwinm in place of rldic */
 /* { dg-final { scan-assembler-times {\mrldic\M|\mrlwinm\M} 1 } } */
 /* -m32 has lfs in place of lfsx */
-/* { dg-final { scan-assembler-times {\mlfsx\M|\mlfs\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mlfsx?\M} 1 } } */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p8.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p8.c
index 6819d271c53..ce435d82c16 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p8.c
+++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-float.p8.c
@@ -24,9 +24,8 @@
 /* { dg-final { scan-assembler-times {\mli\M} 1 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mrlwinm\M} 1 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 { target ilp32 } } } */
-/* { dg-final { scan-assembler-times {\madd\M} 1 { target ilp32 } } } */
 /* { dg-final { scan-assembler-times {\mlfs\M} 1 { target ilp32 } } } */
-/* { dg-final { scan-assembler-times {\maddi\M} 2 { target ilp32 } } } */
+/* { dg-final { scan-assembler-times {\maddi?\M} 2 { target ilp32 } } } */
 
 
 #include 
diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p7.c 
b/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p7.c
index 51636926953..20e3d253489 100644
--- a/gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p7.c
+++ 

[gcc r15-922] [testsuite] conditionalize dg-additional-sources on target and type

2024-05-30 Thread Alexandre Oliva via Gcc-cvs
https://gcc.gnu.org/g:1d71818602f2a7f3b15a811fb20a84d2a177a8e5

commit r15-922-g1d71818602f2a7f3b15a811fb20a84d2a177a8e5
Author: Alexandre Oliva 
Date:   Thu May 30 04:01:19 2024 -0300

[testsuite] conditionalize dg-additional-sources on target and type

g++.dg/vect/pr95401.cc has dg-additional-sources, and that fails when
check_vect_support_and_set_flags finds vector support lacking for
execution tests: tests decay to compile tests, and additional sources
are rejected by the compiler when compiling to a named output file.

At first I considered using some effective target to conditionalize
the additional sources.  There was no support for target-specific
additional sources, so I added that.

But then, I found that adding an effective target to check whether the
test involves linking would just make for busy work in this case, and
so I went ahead and adjusted the handling of additional sources to
refrain from adding them on compile tests, reporting them as
unsupported.

That solves the problem without using the newly-added machinery for
per-target additional sources, but I figured since I'd implemented it
I might as well contribute it, since there might be other uses for it.


for  gcc/ChangeLog

* doc/sourcebuild.texi (dg-additional-sources): Document
newly-added support for target selectors, and implicit discard
on non-linking tests that name the compiler output explicitly.

for  gcc/testsuite/ChangeLog

* lib/gcc-defs.exp (dg-additional-sources): Support target
selectors.  Make it cumulative.
(dg-additional-files-options): Take dest and type.  Note
unsupported additional sources when not linking and naming the
compiler output.  Adjust source dirname prepending to cope
with leading blanks.
* lib/g++.exp (g++_target_compile): Pass dest and type on to
dg-additional-files-options.
* lib/gcc.exp (gcc_target_compile): Likewise.
* lib/gdc.exp (gdb_target_compile): Likewise.
* lib/gfortran.exp (gfortran_target_compile): Likewise.
* lib/go.exp (go_target_compile): Likewise.
* lib/obj-c++.exp (obj-c++_target_compile): Likewise.
* lib/objc.exp (objc_target_compile): Likewise.
* lib/rust.exp (rust_target_compile): Likewise.
* lib/profopt.exp (profopt-execute): Likewise-ish.

Diff:


  1   2   3   4   5   6   7   >