[gcc r15-3079] Makefile.tpl: drop leftover intermodule cruft

2024-08-21 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d6a112afe7cd9ade0d06c3128d1f29b6454a7f5c

commit r15-3079-gd6a112afe7cd9ade0d06c3128d1f29b6454a7f5c
Author: Sam James 
Date:   Wed Aug 14 13:22:02 2024 +0100

Makefile.tpl: drop leftover intermodule cruft

intermodule supported was dropped in r0-103106-gde6ba7aee152a0 with some
remaining bits for Fortran removed in r14-1696-gecc96eb5d2a0e5.

Remove some small leftovers.

* Makefile.in: Regenerate.
* Makefile.tpl (STAGE1_CONFIGURE_FLAGS): Remove 
--disable-intermodule.

Diff:
---
 Makefile.in  | 11 ---
 Makefile.tpl | 11 ---
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 34c5550beca2..a1a56bb5dd2c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -610,14 +610,11 @@ STAGEautofeedback_CONFIGURE_FLAGS = 
$(STAGE_CONFIGURE_FLAGS)
 STAGE1_CFLAGS = @stage1_cflags@
 STAGE1_CHECKING = @stage1_checking@
 STAGE1_LANGUAGES = @stage1_languages@
-# * We force-disable intermodule optimizations, even if
-#   --enable-intermodule was passed, since the installed compiler
-#   probably can't handle them.  Luckily, autoconf always respects
-#   the last argument when conflicting --enable arguments are passed.
-# * Likewise, we force-disable coverage flags, since the installed
-#   compiler probably has never heard of them.
+# * We force-disable coverage flags, since the installed compiler probably
+#   has never heard of them. Luckily, autoconf always respects the last
+#   argument when conflicting --enable arguments are passed.
 # * We also disable -Wformat, since older GCCs don't understand newer %s.
-STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
+STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKING) \
  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
  --disable-build-format-warnings
 
diff --git a/Makefile.tpl b/Makefile.tpl
index 8f4bf297918c..cbb3c6789dcf 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -533,14 +533,11 @@ STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
 STAGE1_CFLAGS = @stage1_cflags@
 STAGE1_CHECKING = @stage1_checking@
 STAGE1_LANGUAGES = @stage1_languages@
-# * We force-disable intermodule optimizations, even if
-#   --enable-intermodule was passed, since the installed compiler
-#   probably can't handle them.  Luckily, autoconf always respects
-#   the last argument when conflicting --enable arguments are passed.
-# * Likewise, we force-disable coverage flags, since the installed
-#   compiler probably has never heard of them.
+# * We force-disable coverage flags, since the installed compiler probably
+#   has never heard of them. Luckily, autoconf always respects the last
+#   argument when conflicting --enable arguments are passed.
 # * We also disable -Wformat, since older GCCs don't understand newer %s.
-STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
+STAGE1_CONFIGURE_FLAGS = $(STAGE1_CHECKING) \
  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
  --disable-build-format-warnings


[gcc r15-3080] Makefile.tpl: fix whitespace in licence header

2024-08-21 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:c1aba5e7e7da5f2bd75873d3853f1de85addc2ac

commit r15-3080-gc1aba5e7e7da5f2bd75873d3853f1de85addc2ac
Author: Sam James 
Date:   Wed Aug 14 13:25:01 2024 +0100

Makefile.tpl: fix whitespace in licence header

* Makefile.in: Regenerate.
* Makefile.tpl: Fix whitespace.

Signed-off-by: Sam James 

Diff:
---
 Makefile.in  | 4 ++--
 Makefile.tpl | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index a1a56bb5dd2c..966d60454960 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -10,12 +10,12 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; see the file COPYING3.  If not see
 # .
diff --git a/Makefile.tpl b/Makefile.tpl
index cbb3c6789dcf..da38dca697ad 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -13,12 +13,12 @@ in
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; see the file COPYING3.  If not see
 # .


[gcc r15-2338] MAINTAINERS: Add myself to write after approval

2024-07-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:7ad6b912d9ebd1f85afb725c8de05b27a97674ea

commit r15-2338-g7ad6b912d9ebd1f85afb725c8de05b27a97674ea
Author: Sam James 
Date:   Fri Jul 26 16:57:42 2024 +0100

MAINTAINERS: Add myself to write after approval

ChangeLog:

* MAINTAINERS: Add myself.

Diff:
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 542d058d727c..595140b6f64f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -550,6 +550,7 @@ Andreas Jaeger  aj  

 Harsha Jagasia  hjagasia
 Fariborz Jahanian   -   
 Martin Jambor   jamborm 
+Sam James   sjames  
 Surya Kumari Jangalajskumari
 Jakub Jelinek   jakub   
 Andrew Jenner   andrewjenner


[gcc r15-2349] testsuite: Add dg-do run to even more tests

2024-07-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:a75c6295252d0d998a18927dc7510fac965134c4

commit r15-2349-ga75c6295252d0d998a18927dc7510fac965134c4
Author: Sam James 
Date:   Thu Jul 18 08:27:29 2024 +0100

testsuite: Add dg-do run to even more tests

All of these are for wrong-code bugs. Confirmed to be used before but
with no execution.

Tested on x86_64-pc-linux-gnu and checked test logs before/after.

2024-07-26  Sam James  

PR target/7559
PR c++/9704
PR c++/16115
PR c++/19317
PR rtl-optimization/11536
PR target/20322
PR tree-optimization/31966
PR rtl-optimization/41033
PR tree-optimization/67947
* g++.dg/cpp1z/byte1.C: Add dg-do run directive.
* g++.dg/init/call1.C: Ditto.
* g++.dg/init/copy5.C: Ditto.
* g++.dg/opt/nrv9.C: Ditto.
* gcc.dg/20021006-1.c: Ditto.
* gcc.dg/20030721-1.c: Ditto.
* gcc.dg/20050307-1.c: Ditto.
* gcc.dg/pr41033.c: Ditto.
* gcc.dg/torture/pr67947.c: Ditto.
* gcc.dg/tree-ssa/pr31966.c: Ditto.
* gcc.dg/tree-ssa/tailcall-3.c: Ditto.
* gcc.dg/tree-ssa/vrp74.c: Ditto.
* gcc.target/nvptx/abort.c: Fix whitespace in dg directive.

Diff:
---
 gcc/testsuite/g++.dg/cpp1z/byte1.C | 2 +-
 gcc/testsuite/g++.dg/init/call1.C  | 1 +
 gcc/testsuite/g++.dg/init/copy5.C  | 1 +
 gcc/testsuite/g++.dg/opt/nrv9.C| 1 +
 gcc/testsuite/gcc.dg/20021006-1.c  | 1 +
 gcc/testsuite/gcc.dg/20030721-1.c  | 3 ++-
 gcc/testsuite/gcc.dg/20050307-1.c  | 1 +
 gcc/testsuite/gcc.dg/pr41033.c | 3 ++-
 gcc/testsuite/gcc.dg/torture/pr67947.c | 1 +
 gcc/testsuite/gcc.dg/tree-ssa/pr31966.c| 1 +
 gcc/testsuite/gcc.dg/tree-ssa/tailcall-3.c | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/vrp74.c  | 1 +
 gcc/testsuite/gcc.target/nvptx/abort.c | 2 +-
 13 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/g++.dg/cpp1z/byte1.C 
b/gcc/testsuite/g++.dg/cpp1z/byte1.C
index 631b18d126c6..e4e3b6e95ac9 100644
--- a/gcc/testsuite/g++.dg/cpp1z/byte1.C
+++ b/gcc/testsuite/g++.dg/cpp1z/byte1.C
@@ -1,5 +1,5 @@
 // Test for std::byte aliasing properties.
-// { dg-do compile { target c++17 } }
+// { dg-do run { target c++17 } }
 // { dg-options "-O3" }
 
 #include 
diff --git a/gcc/testsuite/g++.dg/init/call1.C 
b/gcc/testsuite/g++.dg/init/call1.C
index d44b6dddc953..548d59cc80f4 100644
--- a/gcc/testsuite/g++.dg/init/call1.C
+++ b/gcc/testsuite/g++.dg/init/call1.C
@@ -1,4 +1,5 @@
 // Bug c++/16115
+// { dg-do run }
 // { dg-options "-O2" }
 
 extern "C" void abort(); 
diff --git a/gcc/testsuite/g++.dg/init/copy5.C 
b/gcc/testsuite/g++.dg/init/copy5.C
index cef5a2950ef1..26e3bf81d83f 100644
--- a/gcc/testsuite/g++.dg/init/copy5.C
+++ b/gcc/testsuite/g++.dg/init/copy5.C
@@ -1,3 +1,4 @@
+// { dg-do run }
 // { dg-options "-O2" }
 
 struct BOOL {
diff --git a/gcc/testsuite/g++.dg/opt/nrv9.C b/gcc/testsuite/g++.dg/opt/nrv9.C
index 462506867d43..08bcde8827dd 100644
--- a/gcc/testsuite/g++.dg/opt/nrv9.C
+++ b/gcc/testsuite/g++.dg/opt/nrv9.C
@@ -1,4 +1,5 @@
 // PR c++/19317
+// { dg-do run }
 // If we do both NRV and caller-side return slot opt for ga = f()
 // constructing la sets ga.i to 0 too soon.
 
diff --git a/gcc/testsuite/gcc.dg/20021006-1.c 
b/gcc/testsuite/gcc.dg/20021006-1.c
index 92df2c57f6ef..7904b9f99626 100644
--- a/gcc/testsuite/gcc.dg/20021006-1.c
+++ b/gcc/testsuite/gcc.dg/20021006-1.c
@@ -1,6 +1,7 @@
 /* PR target/7559
This testcase was miscompiled on x86-64 due to wrong access to the struct
members.  */
+/* { dg-do run } */
 
 extern void abort(void);
 
diff --git a/gcc/testsuite/gcc.dg/20030721-1.c 
b/gcc/testsuite/gcc.dg/20030721-1.c
index 5e8ed0b434ad..52be42fc59df 100644
--- a/gcc/testsuite/gcc.dg/20030721-1.c
+++ b/gcc/testsuite/gcc.dg/20030721-1.c
@@ -1,5 +1,6 @@
-/* { dg-options "-O2" } */
 /* PR optimization/11536 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
 /* Origin: sa...@kam.mff.cuni.cz  */
 /* Testcase by Andrew Pinski  */
 
diff --git a/gcc/testsuite/gcc.dg/20050307-1.c 
b/gcc/testsuite/gcc.dg/20050307-1.c
index 0e8dac69a65f..b370a571acac 100644
--- a/gcc/testsuite/gcc.dg/20050307-1.c
+++ b/gcc/testsuite/gcc.dg/20050307-1.c
@@ -1,4 +1,5 @@
 /* PR target/20322 */
+/* { dg-do run } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/pr41033.c b/gcc/testsuite/gcc.dg/pr41033.c
index 5043be2d1191..4c1863c750aa 100644
--- a/gcc/testsuite/gcc.dg/pr41033.c
+++ b/gcc/testsuite/gcc.dg/pr41033.c
@@ -1,5 +1,6 @@
-/* { dg-options "-O1 -fno-strict-aliasing" } */
 /* PR rtl-optimization/41033 */
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-strict-aliasing" } */
 
 struct X {
   int i;
diff --git a/gcc/testsuite/gcc.dg/torture/pr67947.c 
b/gcc/testsuite/gcc.dg/torture/pr67947.c
index 5664c48390af..368a8b20cbf0 100644
--- a/gcc/

[gcc r15-2370] testsuite: fix dg-do ordering wrt dg-require-*

2024-07-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:0ac0e640a7f86ba45b7e13ed018826177197f3ce

commit r15-2370-g0ac0e640a7f86ba45b7e13ed018826177197f3ce
Author: Sam James 
Date:   Sat Jul 27 00:17:03 2024 +0100

testsuite: fix dg-do ordering wrt dg-require-*

Per gccint, dg-do must precede dg-require-effective-target or
dg-require-support. Fix a handful of deviant cases.

gcc/testsuite/ChangeLog:
PR middle-end/25521
PR debug/93122
* gcc.dg/pr25521.c: Fix dg-do directive order.
* gcc.dg/vect/vect-simd-clone-19.c: Likewise.
* gcc.target/arm/stack-protector-7.c: Likewise.
* gcc.target/arm/stack-protector-8.c: Likewise.
* gcc.target/powerpc/pr93122.c: Likewise.

libstdc++-v3/ChangeLog:
PR libstdc++/110572
* testsuite/18_support/type_info/110572.cc: Fix dg-do directive 
order.

Diff:
---
 gcc/testsuite/gcc.dg/pr25521.c| 2 +-
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-19.c| 2 +-
 gcc/testsuite/gcc.target/arm/stack-protector-7.c  | 2 +-
 gcc/testsuite/gcc.target/arm/stack-protector-8.c  | 2 +-
 gcc/testsuite/gcc.target/powerpc/pr93122.c| 2 +-
 libstdc++-v3/testsuite/18_support/type_info/110572.cc | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr25521.c b/gcc/testsuite/gcc.dg/pr25521.c
index 82b4cd88ec05..cd1b90085e11 100644
--- a/gcc/testsuite/gcc.dg/pr25521.c
+++ b/gcc/testsuite/gcc.dg/pr25521.c
@@ -1,8 +1,8 @@
 /* PR middle-end/25521 - place `const volatile' objects in read-only
sections.
 
-   { dg-require-effective-target elf }
{ dg-do compile }
+   { dg-require-effective-target elf }
{ dg-skip-if "" { ! const_volatile_readonly_section } } */
 
 const volatile int foo = 30;
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-19.c 
b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-19.c
index e7ed56ca7547..46d25526479d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-19.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-19.c
@@ -1,5 +1,5 @@
-/* { dg-require-effective-target vect_simd_clones } */
 /* { dg-do compile } */
+/* { dg-require-effective-target vect_simd_clones } */
 
 int __attribute__ ((__simd__, const)) fn (int);
 
diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-7.c 
b/gcc/testsuite/gcc.target/arm/stack-protector-7.c
index 2173bc5a35a0..23207fd98c84 100644
--- a/gcc/testsuite/gcc.target/arm/stack-protector-7.c
+++ b/gcc/testsuite/gcc.target/arm/stack-protector-7.c
@@ -1,6 +1,6 @@
+/* { dg-do compile } */
 /* { dg-require-effective-target arm_hard_vfp_ok }  */
 /* { dg-require-effective-target arm_arch_v7a_ok } */
-/* { dg-do compile } */
 /* { dg-options "-march=armv7-a -mfpu=vfp -fstack-protector-all -Os 
-mstack-protector-guard=tls -mstack-protector-guard-offset=1296 -mtp=cp15" } */
 
 #include "stack-protector-5.c"
diff --git a/gcc/testsuite/gcc.target/arm/stack-protector-8.c 
b/gcc/testsuite/gcc.target/arm/stack-protector-8.c
index ea5ef3211678..165f34706cc4 100644
--- a/gcc/testsuite/gcc.target/arm/stack-protector-8.c
+++ b/gcc/testsuite/gcc.target/arm/stack-protector-8.c
@@ -1,6 +1,6 @@
+/* { dg-do compile } */
 /* { dg-require-effective-target arm_hard_vfp_ok }  */
 /* { dg-require-effective-target arm_arch_v7a_ok } */
-/* { dg-do compile } */
 /* { dg-error "needs a hardware TLS register" "missing error when using TLS 
stack protector without hardware TLS register" { target *-*-* } 0 } */
 /* { dg-options "-fstack-protector-all -Os -mstack-protector-guard=tls 
-mtp=soft" } */
 
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93122.c 
b/gcc/testsuite/gcc.target/powerpc/pr93122.c
index 97bcb0cea5ff..42d1d94ba15f 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr93122.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr93122.c
@@ -1,6 +1,6 @@
 /* PR target/93122 */
-/* { dg-require-effective-target power10_ok } */
 /* { dg-do compile { target lp64 } } */
+/* { dg-require-effective-target power10_ok } */
 /* { dg-options "-fstack-clash-protection -mprefixed -mdejagnu-cpu=power10" } 
*/
 
 void bar (char *);
diff --git a/libstdc++-v3/testsuite/18_support/type_info/110572.cc 
b/libstdc++-v3/testsuite/18_support/type_info/110572.cc
index 64081879b77d..f727653adfb1 100644
--- a/libstdc++-v3/testsuite/18_support/type_info/110572.cc
+++ b/libstdc++-v3/testsuite/18_support/type_info/110572.cc
@@ -1,7 +1,7 @@
 // { dg-options "-static-libstdc++" }
+// { dg-do link }
 // { dg-require-static-libstdcxx }
 // { dg-require-cpp-feature-test __cpp_rtti }
-// { dg-do link }
 
 #include 


[gcc r15-2371] testsuite: fix dg-add-options vs. dg-options ordering

2024-07-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:542e3c4f0551f9a239163d09d98527d8d7d0200d

commit r15-2371-g542e3c4f0551f9a239163d09d98527d8d7d0200d
Author: Sam James 
Date:   Sat Jul 27 00:31:54 2024 +0100

testsuite: fix dg-add-options vs. dg-options ordering

Per gccint, dg-add-options must be placed after all dg-options directives.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/cmpmem-2.c: Fix dg-add-options order.

Diff:
---
 gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c 
b/gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c
index c782cc6c6e6e..fdb402a787b4 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/cmpmem-2.c
@@ -1,6 +1,6 @@
 /* { dg-do run { target { riscv_v } } } */
-/* { dg-add-options riscv_v } */
 /* { dg-options "-O2 -mrvv-max-lmul=dynamic" } */
+/* { dg-add-options riscv_v } */
 
 #include 


[gcc r15-2383] testsuite: make PR115277 test an execute one

2024-07-29 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ca255ca2760a5e6176031ea62a9c29c7bb92c212

commit r15-2383-gca255ca2760a5e6176031ea62a9c29c7bb92c212
Author: Sam James 
Date:   Mon Jul 29 16:47:09 2024 +0100

testsuite: make PR115277 test an execute one

PR middle-end/115277
* gcc.c-torture/compile/pr115277.c: Rename to...
* gcc.c-torture/execute/pr115277.c: ...this.

Diff:
---
 gcc/testsuite/gcc.c-torture/{compile => execute}/pr115277.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr115277.c 
b/gcc/testsuite/gcc.c-torture/execute/pr115277.c
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/compile/pr115277.c
rename to gcc/testsuite/gcc.c-torture/execute/pr115277.c


[gcc r15-2388] testsuite: fix PR111613 test

2024-07-29 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:5e5d7a88932b132437069f716160f8b20862890b

commit r15-2388-g5e5d7a88932b132437069f716160f8b20862890b
Author: Sam James 
Date:   Mon Jul 29 21:47:16 2024 +0100

testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

Diff:
---
 gcc/testsuite/gcc.c-torture/{ => execute}/pr111613.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/execute/pr111613.c
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/pr111613.c
rename to gcc/testsuite/gcc.c-torture/execute/pr111613.c


[gcc r15-2403] testsuite: fix dg-do run whitespace

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:136f364e26d9ad4f05e0005e480813cdc8f56c96

commit r15-2403-g136f364e26d9ad4f05e0005e480813cdc8f56c96
Author: Sam James 
Date:   Tue Jul 30 11:08:31 2024 +0100

testsuite: fix dg-do run whitespace

This caused the tests to not be run. I may do further passes for non-run
next.

Tested on x86_64-pc-linux-gnu and checked test logs before/after.

PR c/53548
PR target/101529
PR tree-optimization/102359
* c-c++-common/fam-in-union-alone-in-struct-1.c: Fix whitespace in 
dg directive.
* c-c++-common/fam-in-union-alone-in-struct-2.c: Likewise.
* c-c++-common/torture/builtin-shufflevector-2.c: Likewise.
* g++.dg/pr102359_2.C: Likewise.
* g++.target/i386/mvc1.C: Likewise.

Diff:
---
 gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-1.c  | 2 +-
 gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c  | 2 +-
 gcc/testsuite/c-c++-common/torture/builtin-shufflevector-2.c | 2 +-
 gcc/testsuite/g++.dg/pr102359_2.C| 2 +-
 gcc/testsuite/g++.target/i386/mvc1.C | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-1.c 
b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-1.c
index 7d4721aa95ac..39ebf17850bf 100644
--- a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-1.c
+++ b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-1.c
@@ -1,6 +1,6 @@
 /* testing the correct usage of flexible array members in unions 
and alone in structures.  */
-/* { dg-do run} */
+/* { dg-do run } */
 /* { dg-options "-Wpedantic" } */
 
 union with_fam_1 {
diff --git a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c 
b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
index 3743f9e7dac5..93f9d5128f6e 100644
--- a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
+++ b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
@@ -1,6 +1,6 @@
 /* testing the correct usage of flexible array members in unions 
and alone in structures: initialization  */
-/* { dg-do run} */
+/* { dg-do run } */
 /* { dg-options "-O2" } */
 
 union with_fam_1 {
diff --git a/gcc/testsuite/c-c++-common/torture/builtin-shufflevector-2.c 
b/gcc/testsuite/c-c++-common/torture/builtin-shufflevector-2.c
index b1ffc95e39ae..a84e0a626211 100644
--- a/gcc/testsuite/c-c++-common/torture/builtin-shufflevector-2.c
+++ b/gcc/testsuite/c-c++-common/torture/builtin-shufflevector-2.c
@@ -1,4 +1,4 @@
-/* { dg-do run}  */
+/* { dg-do run }  */
 /* PR target/101529 */
 typedef unsigned char C;
 typedef unsigned char __attribute__((__vector_size__ (8))) V;
diff --git a/gcc/testsuite/g++.dg/pr102359_2.C 
b/gcc/testsuite/g++.dg/pr102359_2.C
index d026d727dd5c..1b3f6147dec1 100644
--- a/gcc/testsuite/g++.dg/pr102359_2.C
+++ b/gcc/testsuite/g++.dg/pr102359_2.C
@@ -1,6 +1,6 @@
 /* PR middle-end/102359 ICE gimplification failed since
r12-3433-ga25e0b5e6ac8a77a.  */
-/* { dg-do run} */
+/* { dg-do run } */
 /* { dg-options "-ftrivial-auto-var-init=zero" } */
 /* { dg-require-effective-target c++17 } */
 
diff --git a/gcc/testsuite/g++.target/i386/mvc1.C 
b/gcc/testsuite/g++.target/i386/mvc1.C
index b307d01ace63..348bd0ec7202 100644
--- a/gcc/testsuite/g++.target/i386/mvc1.C
+++ b/gcc/testsuite/g++.target/i386/mvc1.C
@@ -1,4 +1,4 @@
-/* { dg-do run} */
+/* { dg-do run } */
 /* { dg-require-ifunc "" } */
 
 __attribute__((target_clones("avx","arch=slm","arch=core-avx2","default")))


[gcc r15-2412] testsuite: fix whitespace in dg-do compile directives

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2e662dedf84aa23fdff7bceca040432bf9f1ab72

commit r15-2412-g2e662dedf84aa23fdff7bceca040432bf9f1ab72
Author: Sam James 
Date:   Tue Jul 30 12:20:47 2024 +0100

testsuite: fix whitespace in dg-do compile directives

Nothing seems to change here in reality at least on x86_64-pc-linux-gnu,
but important to fix nonetheless in case people copy it.

PR rtl-optimization/48633
PR tree-optimization/83072
PR tree-optimization/83073
PR tree-optimization/96542
PR tree-optimization/96707
PR tree-optimization/97567
PR target/69225
PR target/89929
PR target/96562
* g++.dg/pr48633.C: Fix whitespace in dg directive.
* g++.dg/pr96707.C: Likewise.
* g++.target/i386/mv28.C: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-1.c: Likewise.
* gcc.dg/pr83072-2.c: Likewise.
* gcc.dg/pr83073.c: Likewise.
* gcc.dg/pr96542.c: Likewise.
* gcc.dg/pr97567-2.c: Likewise.
* gcc.target/i386/avx512fp16-11a.c: Likewise.
* gcc.target/i386/avx512fp16-13.c: Likewise.
* gcc.target/i386/avx512fp16-14.c: Likewise.
* gcc.target/i386/avx512fp16-conjugation-1.c: Likewise.
* gcc.target/i386/avx512fp16-neg-1a.c: Likewise.
* gcc.target/i386/avx512fp16-set1-pch-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-conjugation-1.c: Likewise.
* gcc.target/i386/avx512fp16vl-neg-1a.c: Likewise.
* gcc.target/i386/avx512fp16vl-set1-pch-1a.c: Likewise.
* gcc.target/i386/avx512vlfp16-11a.c: Likewise.
* gcc.target/i386/pr69225-1.c: Likewise.
* gcc.target/i386/pr69225-2.c: Likewise.
* gcc.target/i386/pr69225-3.c: Likewise.
* gcc.target/i386/pr69225-4.c: Likewise.
* gcc.target/i386/pr69225-5.c: Likewise.
* gcc.target/i386/pr69225-6.c: Likewise.
* gcc.target/i386/pr69225-7.c: Likewise.
* gcc.target/i386/pr96562-1.c: Likewise.
* gcc.target/riscv/rv32e_stack.c: Likewise.
* gfortran.dg/c-interop/removed-restrictions-3.f90: Likewise.
* gnat.dg/renaming1.adb: Likewise.

Diff:
---
 gcc/testsuite/g++.dg/pr48633.C | 2 +-
 gcc/testsuite/g++.dg/pr96707.C | 2 +-
 gcc/testsuite/g++.target/i386/mv28.C   | 2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-flex-arrays-1.c | 2 +-
 gcc/testsuite/gcc.dg/pr83072-2.c   | 2 +-
 gcc/testsuite/gcc.dg/pr83073.c | 2 +-
 gcc/testsuite/gcc.dg/pr96542.c | 2 +-
 gcc/testsuite/gcc.dg/pr97567-2.c   | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-11a.c | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-13.c  | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-14.c  | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-conjugation-1.c   | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-neg-1a.c  | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16-set1-pch-1a.c | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16vl-conjugation-1.c | 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1a.c| 2 +-
 gcc/testsuite/gcc.target/i386/avx512fp16vl-set1-pch-1a.c   | 2 +-
 gcc/testsuite/gcc.target/i386/avx512vlfp16-11a.c   | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-1.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-2.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-3.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-4.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-5.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-6.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr69225-7.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr96562-1.c  | 2 +-
 gcc/testsuite/gcc.target/riscv/rv32e_stack.c   | 2 +-
 gcc/testsuite/gfortran.dg/c-interop/removed-restrictions-3.f90 | 2 +-
 gcc/testsuite/gnat.dg/renaming1.adb| 2 +-
 29 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/gcc/testsuite/g++.dg/pr48633.C b/gcc/testsuite/g++.dg/pr48633.C
index 90f053a74c88..efcdab02acbd 100644
--- a/gcc/testsuite/g++.dg/pr48633.C
+++ b/gcc/testsuite/g++.dg/pr48633.C
@@ -1,4 +1,4 @@
-/* { dg-do compile} */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fira-region=all -fnon-call-exceptions" } */
 extern long double getme (void);
 extern void useme (long double);
diff --git a/gcc/testsuite/g++.dg/pr96707.C b/gcc/testsuite/g++.dg/pr96707.C
index 2653fe3d0431..868ee416e269 100644
--- a/gcc/testsuite/g++.dg/pr96707.C
+++ b/gcc

[gcc r15-2413] testsuite: fix whitespace in dg-do preprocess directive

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:7f1aa73bde0babde0ed3ff58d7226b86d25d075d

commit r15-2413-g7f1aa73bde0babde0ed3ff58d7226b86d25d075d
Author: Sam James 
Date:   Tue Jul 30 12:21:42 2024 +0100

testsuite: fix whitespace in dg-do preprocess directive

PR preprocessor/90581
* c-c++-common/cpp/fmax-include-depth.c: Fix whitespace in dg 
directive.

Diff:
---
 gcc/testsuite/c-c++-common/cpp/fmax-include-depth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/cpp/fmax-include-depth.c 
b/gcc/testsuite/c-c++-common/cpp/fmax-include-depth.c
index bd8cc3adcdd7..134c29805c89 100644
--- a/gcc/testsuite/c-c++-common/cpp/fmax-include-depth.c
+++ b/gcc/testsuite/c-c++-common/cpp/fmax-include-depth.c
@@ -1,4 +1,4 @@
-/* { dg-do preprocess} */
+/* { dg-do preprocess } */
 /* { dg-options "-fmax-include-depth=1" } */
 
 #include "fmax-include-depth-1b.h" /* { dg-error ".include nested depth 1 
exceeds maximum of 1 .use -fmax-include-depth=DEPTH to increase the maximum." } 
*/


[gcc r15-2414] testsuite: fix whitespace in dg-do assemble directive

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2d105efd6f60dce4d57380cf9820a4dd52cc8abb

commit r15-2414-g2d105efd6f60dce4d57380cf9820a4dd52cc8abb
Author: Sam James 
Date:   Tue Jul 30 17:10:01 2024 +0100

testsuite: fix whitespace in dg-do assemble directive

* gcc.target/aarch64/simd/vmmla.c: Fix whitespace in dg directive.

Diff:
---
 gcc/testsuite/gcc.target/aarch64/simd/vmmla.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vmmla.c 
b/gcc/testsuite/gcc.target/aarch64/simd/vmmla.c
index 5eec2b5cfb96..777decc56a20 100644
--- a/gcc/testsuite/gcc.target/aarch64/simd/vmmla.c
+++ b/gcc/testsuite/gcc.target/aarch64/simd/vmmla.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble} */
+/* { dg-do assemble } */
 /* { dg-require-effective-target arm_v8_2a_i8mm_ok } */
 /* { dg-additional-options "-march=armv8.2-a+i8mm" } */


[gcc r15-2417] testsuite: fix whitespace in dg-require-effective-target directives

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ee12a13d25778a1ad8a9b5dc63aadf9f4320088b

commit r15-2417-gee12a13d25778a1ad8a9b5dc63aadf9f4320088b
Author: Sam James 
Date:   Tue Jul 30 17:23:08 2024 +0100

testsuite: fix whitespace in dg-require-effective-target directives

PR middle-end/54400
PR target/98161
* gcc.dg/vect/bb-slp-layout-18.c: Fix whitespace in dg directive.
* gcc.dg/vect/bb-slp-pr54400.c: Likewise.
* gcc.target/i386/pr98161.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.dg/vect/bb-slp-layout-18.c | 2 +-
 gcc/testsuite/gcc.dg/vect/bb-slp-pr54400.c   | 2 +-
 gcc/testsuite/gcc.target/i386/pr98161.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-layout-18.c 
b/gcc/testsuite/gcc.dg/vect/bb-slp-layout-18.c
index ff4627225074..ebbf9d2da7ca 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-layout-18.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-layout-18.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target vect_float} */
+/* { dg-require-effective-target vect_float } */
 /* { dg-additional-options "-w -Wno-psabi -ffast-math" } */
 
 typedef float v4sf __attribute__((vector_size(sizeof(float)*4)));
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr54400.c 
b/gcc/testsuite/gcc.dg/vect/bb-slp-pr54400.c
index 6ecd51103ed8..745e3ced70ea 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr54400.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr54400.c
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_float} */
+/* { dg-require-effective-target vect_float } */
 /* { dg-additional-options "-w -Wno-psabi -ffast-math" } */
 
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr98161.c 
b/gcc/testsuite/gcc.target/i386/pr98161.c
index 5825b9bd1dbb..8ea93325214f 100644
--- a/gcc/testsuite/gcc.target/i386/pr98161.c
+++ b/gcc/testsuite/gcc.target/i386/pr98161.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -msse4" } */
-/* { dg-require-effective-target sse4} */
+/* { dg-require-effective-target sse4 } */
 
 typedef unsigned short u16;
 typedef unsigned int   u32;


[gcc r15-2421] testsuite: fix 'dg-compile' typos

2024-07-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:acc70606c59e3f14072cc8a164362e728d8df5d6

commit r15-2421-gacc70606c59e3f14072cc8a164362e728d8df5d6
Author: Sam James 
Date:   Tue Jul 30 20:04:40 2024 +0100

testsuite: fix 'dg-compile' typos

'dg-compile' is not a thing, replace it with 'dg-do compile'.

PR target/68015
PR c++/83979
* c-c++-common/goacc/loop-shape.c: Fix 'dg-compile' typo.
* g++.dg/pr83979.C: Likewise.
* g++.target/aarch64/sve/acle/general-c++/attributes_2.C: Likewise.
* gcc.dg/tree-ssa/builtin-sprintf-7.c: Likewise.
* gcc.dg/tree-ssa/builtin-sprintf-8.c: Likewise.
* gcc.target/riscv/amo/zabha-rvwmo-all-amo-ops-char.c: Likewise.
* gcc.target/riscv/amo/zabha-rvwmo-all-amo-ops-short.c: Likewise.
* gcc.target/s390/20181024-1.c: Likewise.
* gcc.target/s390/addr-constraints-1.c: Likewise.
* gcc.target/s390/arch12/aghsghmgh-1.c: Likewise.
* gcc.target/s390/arch12/mul-1.c: Likewise.
* gcc.target/s390/arch13/bitops-1.c: Likewise.
* gcc.target/s390/arch13/bitops-2.c: Likewise.
* gcc.target/s390/arch13/fp-signedint-convert-1.c: Likewise.
* gcc.target/s390/arch13/fp-unsignedint-convert-1.c: Likewise.
* gcc.target/s390/arch13/popcount-1.c: Likewise.
* gcc.target/s390/pr68015.c: Likewise.
* gcc.target/s390/vector/fp-signedint-convert-1.c: Likewise.
* gcc.target/s390/vector/fp-unsignedint-convert-1.c: Likewise.
* gcc.target/s390/vector/reverse-elements-1.c: Likewise.
* gcc.target/s390/vector/reverse-elements-2.c: Likewise.
* gcc.target/s390/vector/reverse-elements-3.c: Likewise.
* gcc.target/s390/vector/reverse-elements-4.c: Likewise.
* gcc.target/s390/vector/reverse-elements-5.c: Likewise.
* gcc.target/s390/vector/reverse-elements-6.c: Likewise.
* gcc.target/s390/vector/reverse-elements-7.c: Likewise.
* gnat.dg/alignment15.adb: Likewise.
* gnat.dg/debug4.adb: Likewise.
* gnat.dg/inline21.adb: Likewise.
* gnat.dg/inline22.adb: Likewise.
* gnat.dg/opt37.adb: Likewise.
* gnat.dg/warn13.adb: Likewise.

Diff:
---
 gcc/testsuite/c-c++-common/goacc/loop-shape.c| 2 +-
 gcc/testsuite/g++.dg/pr83979.C   | 2 +-
 gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/attributes_2.C | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-7.c| 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-8.c| 2 +-
 gcc/testsuite/gcc.target/riscv/amo/zabha-rvwmo-all-amo-ops-char.c| 2 +-
 gcc/testsuite/gcc.target/riscv/amo/zabha-rvwmo-all-amo-ops-short.c   | 2 +-
 gcc/testsuite/gcc.target/s390/20181024-1.c   | 2 +-
 gcc/testsuite/gcc.target/s390/addr-constraints-1.c   | 2 +-
 gcc/testsuite/gcc.target/s390/arch12/aghsghmgh-1.c   | 2 +-
 gcc/testsuite/gcc.target/s390/arch12/mul-1.c | 2 +-
 gcc/testsuite/gcc.target/s390/arch13/bitops-1.c  | 2 +-
 gcc/testsuite/gcc.target/s390/arch13/bitops-2.c  | 2 +-
 gcc/testsuite/gcc.target/s390/arch13/fp-signedint-convert-1.c| 2 +-
 gcc/testsuite/gcc.target/s390/arch13/fp-unsignedint-convert-1.c  | 2 +-
 gcc/testsuite/gcc.target/s390/arch13/popcount-1.c| 2 +-
 gcc/testsuite/gcc.target/s390/pr68015.c  | 2 +-
 gcc/testsuite/gcc.target/s390/vector/fp-signedint-convert-1.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/fp-unsignedint-convert-1.c  | 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-1.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-2.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-3.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-4.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-5.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-6.c| 2 +-
 gcc/testsuite/gcc.target/s390/vector/reverse-elements-7.c| 2 +-
 gcc/testsuite/gnat.dg/alignment15.adb| 2 +-
 gcc/testsuite/gnat.dg/debug4.adb | 2 +-
 gcc/testsuite/gnat.dg/inline21.adb   | 2 +-
 gcc/testsuite/gnat.dg/inline22.adb   | 2 +-
 gcc/testsuite/gnat.dg/opt37.adb  | 2 +-
 gcc/testsuite/gnat.dg/warn13.adb | 2 +-
 32 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/goacc/loop-shape.c 
b/gcc/testsuite/c-c++-common/goacc/loop-shape.c
index 9708f7bf5eb3..b3199b4044

[gcc r15-2439] testsuite: libgomp: fix dg-do run typo

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:1c85b16f1916397886a53b70ef360618b5df7977

commit r15-2439-g1c85b16f1916397886a53b70ef360618b5df7977
Author: Sam James 
Date:   Thu Jul 18 03:42:44 2024 +0100

testsuite: libgomp: fix dg-do run typo

'dg-run' is not a valid dejagnu directive, 'dg-do run' is needed here
for the test to be executed.

That said, it actually seems to be executed for me anyway, presumably
a default in the directory, but let's fix it to be consistent with
other uses in the tree and in that test directory even.

libgomp/ChangeLog:
* testsuite/libgomp.c++/declare-target-indirect-1.C: Fix 'dg-run' 
typo.

Diff:
---
 libgomp/testsuite/libgomp.c++/declare-target-indirect-1.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/testsuite/libgomp.c++/declare-target-indirect-1.C 
b/libgomp/testsuite/libgomp.c++/declare-target-indirect-1.C
index 1eac6b3fa96b..bd84b492feec 100644
--- a/libgomp/testsuite/libgomp.c++/declare-target-indirect-1.C
+++ b/libgomp/testsuite/libgomp.c++/declare-target-indirect-1.C
@@ -1,4 +1,4 @@
-// { dg-run }
+// { dg-do run }
 
 #pragma omp begin declare target indirect
 class C


[gcc r15-2440] testsuite: fix 'dg-do-compile' typos

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:21fc6d35f27cdf4c56e9f093894f6728c55ecb0e

commit r15-2440-g21fc6d35f27cdf4c56e9f093894f6728c55ecb0e
Author: Sam James 
Date:   Tue Jul 30 21:44:12 2024 +0100

testsuite: fix 'dg-do-compile' typos

We want 'dg-do compile', not 'dg-do-compile'. Fix that.

PR target/69194
PR c++/92024
PR c++/110057
* c-c++-common/Wshadow-1.c: Fix 'dg-do compile' typo.
* g++.dg/tree-ssa/devirt-array-destructor-1.C: Likewise.
* g++.dg/tree-ssa/devirt-array-destructor-2.C: Likewise.
* gcc.target/arm/pr69194.c: Likewise.

Diff:
---
 gcc/testsuite/c-c++-common/Wshadow-1.c| 2 +-
 gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C | 2 +-
 gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-2.C | 2 +-
 gcc/testsuite/gcc.target/arm/pr69194.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/Wshadow-1.c 
b/gcc/testsuite/c-c++-common/Wshadow-1.c
index 4d1edf07f002..3cd99e9087ec 100644
--- a/gcc/testsuite/c-c++-common/Wshadow-1.c
+++ b/gcc/testsuite/c-c++-common/Wshadow-1.c
@@ -1,4 +1,4 @@
-/* { dg-do-compile } */
+/* { dg-do compile } */
 /* { dg-additional-options "-Wshadow=local -Wno-shadow=compatible-local" } */
 int c;
 void foo(int *c, int *d)   /* { dg-bogus   "Wshadow" } */
diff --git a/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C 
b/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C
index ce8dc2a57cd7..eed9a7c17698 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-1.C
@@ -1,5 +1,5 @@
 // PR c++/110057
-/* { dg-do-compile } */
+/* { dg-do compile } */
 /* Virtual calls should be devirtualized because we know dynamic type of 
object in array at compile time */
 /* { dg-options "-O3 -fdump-tree-optimized -fno-inline"  } */
 
diff --git a/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-2.C 
b/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-2.C
index 6b44dc1a4eea..448f3739700f 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-2.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/devirt-array-destructor-2.C
@@ -1,5 +1,5 @@
 // PR c++/110057
-/* { dg-do-compile } */
+/* { dg-do compile } */
 /* Virtual calls should be devirtualized because we know dynamic type of 
object in array at compile time */
 /* { dg-options "-O3 -fdump-tree-optimized -fno-inline"  } */
 
diff --git a/gcc/testsuite/gcc.target/arm/pr69194.c 
b/gcc/testsuite/gcc.target/arm/pr69194.c
index 477d5f92c8ec..dc1b0d306c2b 100644
--- a/gcc/testsuite/gcc.target/arm/pr69194.c
+++ b/gcc/testsuite/gcc.target/arm/pr69194.c
@@ -1,5 +1,5 @@
 /* PR target/69194 */
-/* { dg-do-compile } */
+/* { dg-do compile } */
 /* { dg-require-effective-target arm_neon_ok } */
 /* { dg-options "-O2" } */
 /* { dg-add-options arm_neon } */


[gcc r15-2441] testsuite: fix 'dg-do-preprocess' typo

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d398581485b4141b43b11f27c8eb359a99fe4ca9

commit r15-2441-gd398581485b4141b43b11f27c8eb359a99fe4ca9
Author: Sam James 
Date:   Tue Jul 30 21:46:29 2024 +0100

testsuite: fix 'dg-do-preprocess' typo

We want 'dg-do preprocess', not 'dg-do-preprocess'. Fix that.

PR target/106828
* g++.target/loongarch/pr106828.C: Fix 'dg-do compile' typo.

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

diff --git a/gcc/testsuite/g++.target/loongarch/pr106828.C 
b/gcc/testsuite/g++.target/loongarch/pr106828.C
index 190c1db715f4..0d13cbbd5153 100644
--- a/gcc/testsuite/g++.target/loongarch/pr106828.C
+++ b/gcc/testsuite/g++.target/loongarch/pr106828.C
@@ -1,4 +1,4 @@
-/* { dg-do-preprocess } */
+/* { dg-do preprocess } */
 /* { dg-options "-mabi=lp64d -fsanitize=address" } */
 
 /* Tests whether the compiler supports compile option '-fsanitize=address'.  */


[gcc r15-2443] testsuite: fix dg-require-* order vs dg-additional-sources

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d498e79ebe90415047b0bdfdb70e0d579a88965b

commit r15-2443-gd498e79ebe90415047b0bdfdb70e0d579a88965b
Author: Sam James 
Date:   Tue Jul 30 22:01:42 2024 +0100

testsuite: fix dg-require-* order vs dg-additional-sources

Per gccint, 'dg-require-*' must come before any
'dg-additional-sources' directives. Fix a handful of deviant cases.

* gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c: Fix 
dg-require-profiling
directive order.
* gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c | 2 +-
 gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c 
b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
index b57d30f91637..f6ec71a9298d 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-1.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target lto } */
-/* { dg-additional-sources "crossmodule-indir-call-topn-1a.c" } */
 /* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-additional-sources "crossmodule-indir-call-topn-1a.c" } */
 /* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
 
 #ifdef FOR_AUTOFDO_TESTING
diff --git a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c 
b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
index 6b5ae93214a5..2ace3c3b9bf1 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indir-call-topn-2.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target lto } */
-/* { dg-additional-sources "crossmodule-indir-call-topn-1a.c" } */
 /* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-additional-sources "crossmodule-indir-call-topn-1a.c" } */
 /* { dg-options "-O2 -flto -DDOJOB=1 -fdump-ipa-profile_estimate" } */
 
 #ifdef FOR_AUTOFDO_TESTING


[gcc r15-2442] testsuite: fix dg-require-effective-target order vs dg-additional-sources

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:9ad3d1c5814976b8dcd3821bb27ec3bfe9c32aec

commit r15-2442-g9ad3d1c5814976b8dcd3821bb27ec3bfe9c32aec
Author: Sam James 
Date:   Tue Jul 30 21:55:30 2024 +0100

testsuite: fix dg-require-effective-target order vs dg-additional-sources

Per gccint, 'dg-require-effective-target' must come before any
'dg-additional-sources' directives. Fix a handful of deviant cases.

gcc/testsuite/ChangeLog:
* gcc.target/aarch64/aapcs64/func-ret-3.c: Fix 
dg-require-effective-target directive order.
* gcc.target/aarch64/aapcs64/func-ret-4.c: Likewise.
* gfortran.dg/PR100914.f90: Likewise.

libgomp/ChangeLog:
* testsuite/libgomp.c++/pr24455.C: Fix dg-require-effective-target 
directive order.
* testsuite/libgomp.c/pr24455.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c | 2 +-
 gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c | 2 +-
 gcc/testsuite/gfortran.dg/PR100914.f90| 2 +-
 libgomp/testsuite/libgomp.c++/pr24455.C   | 2 +-
 libgomp/testsuite/libgomp.c/pr24455.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c 
b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c
index 1d35ebf14b4b..ebd2e8dd8791 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-3.c
@@ -4,9 +4,9 @@
in AAPCS64 \S 4.3.5.  */
 
 /* { dg-do run { target aarch64-*-* } } */
+/* { dg-require-effective-target aarch64_big_endian } */
 /* { dg-additional-options "-mbranch-protection=none" } */
 /* { dg-additional-sources "abitest.S" } */
-/* { dg-require-effective-target aarch64_big_endian } */
 
 #ifndef IN_FRAMEWORK
 #define TESTFILE "func-ret-3.c"
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c 
b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c
index 15e1408c62d7..03d42f3dd047 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/func-ret-4.c
@@ -5,9 +5,9 @@
are treated as general composite types.  */
 
 /* { dg-do run { target aarch64*-*-* } } */
+/* { dg-require-effective-target aarch64_big_endian } */
 /* { dg-additional-options "-mbranch-protection=none" } */
 /* { dg-additional-sources "abitest.S" } */
-/* { dg-require-effective-target aarch64_big_endian } */
 
 #ifndef IN_FRAMEWORK
 #define TESTFILE "func-ret-4.c"
diff --git a/gcc/testsuite/gfortran.dg/PR100914.f90 
b/gcc/testsuite/gfortran.dg/PR100914.f90
index 8588157e59c0..161f1265fa21 100644
--- a/gcc/testsuite/gfortran.dg/PR100914.f90
+++ b/gcc/testsuite/gfortran.dg/PR100914.f90
@@ -1,7 +1,7 @@
 ! Fails on x86 targets where sizeof(long double) == 16.
 ! { dg-do run }
-! { dg-additional-sources PR100914.c }
 ! { dg-require-effective-target fortran_real_c_float128 }
+! { dg-additional-sources PR100914.c }
 ! { dg-additional-options "-Wno-pedantic" }
 !
 ! Test the fix for PR100914
diff --git a/libgomp/testsuite/libgomp.c++/pr24455.C 
b/libgomp/testsuite/libgomp.c++/pr24455.C
index 8256b6693c8f..9816d37461a5 100644
--- a/libgomp/testsuite/libgomp.c++/pr24455.C
+++ b/libgomp/testsuite/libgomp.c++/pr24455.C
@@ -1,6 +1,6 @@
 // { dg-do run }
-// { dg-additional-sources pr24455-1.C }
 // { dg-require-effective-target tls_runtime }
+// { dg-additional-sources pr24455-1.C }
 // { dg-options "-fno-extern-tls-init" }
 
 extern "C" void abort (void);
diff --git a/libgomp/testsuite/libgomp.c/pr24455.c 
b/libgomp/testsuite/libgomp.c/pr24455.c
index 8af449e7b5c3..4284c1095293 100644
--- a/libgomp/testsuite/libgomp.c/pr24455.c
+++ b/libgomp/testsuite/libgomp.c/pr24455.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
-/* { dg-additional-sources pr24455-1.c } */
 /* { dg-require-effective-target tls_runtime } */
+/* { dg-additional-sources pr24455-1.c } */
 
 extern void abort (void);


[gcc r15-2453] libstdc++: drop bogus 'dg_do run' directive

2024-07-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:f7221267238395ff66da962271fdcf7c7f9bb7dd

commit r15-2453-gf7221267238395ff66da962271fdcf7c7f9bb7dd
Author: Sam James 
Date:   Tue Jul 30 21:39:48 2024 +0100

libstdc++: drop bogus 'dg_do run' directive

We already have a valid 'dg-do run' (- vs _) directive, so drop the bogus
one.

libstdc++-v3/ChangeLog:
* testsuite/28_regex/traits/char/translate.cc: Drop bogus 'dg_do 
run'.

Diff:
---
 libstdc++-v3/testsuite/28_regex/traits/char/translate.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/28_regex/traits/char/translate.cc 
b/libstdc++-v3/testsuite/28_regex/traits/char/translate.cc
index e2552e3cbf05..65119e67e25b 100644
--- a/libstdc++-v3/testsuite/28_regex/traits/char/translate.cc
+++ b/libstdc++-v3/testsuite/28_regex/traits/char/translate.cc
@@ -1,4 +1,3 @@
-// { dg_do run }
 // { dg-do run { target c++11 } }
 // { dg-timeout-factor 2 }


[gcc r14-10780] testsuite: fix PR111613 test

2024-10-13 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d8ac855f796b0cf47d80c713d2f01943dffec0b7

commit r14-10780-gd8ac855f796b0cf47d80c713d2f01943dffec0b7
Author: Sam James 
Date:   Mon Jul 29 21:47:16 2024 +0100

testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

(cherry picked from commit 5e5d7a88932b132437069f716160f8b20862890b)

Diff:
---
 gcc/testsuite/gcc.c-torture/{ => execute}/pr111613.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/execute/pr111613.c
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/pr111613.c
rename to gcc/testsuite/gcc.c-torture/execute/pr111613.c


[gcc r12-10772] testsuite: fix PR111613 test

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:0e3580191b449e599a4c8d7bfd634df2ca351d4a

commit r12-10772-g0e3580191b449e599a4c8d7bfd634df2ca351d4a
Author: Sam James 
Date:   Mon Jul 29 21:47:16 2024 +0100

testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

(cherry picked from commit 5e5d7a88932b132437069f716160f8b20862890b)

Diff:
---
 gcc/testsuite/gcc.c-torture/{ => execute}/pr111613.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/execute/pr111613.c
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/pr111613.c
rename to gcc/testsuite/gcc.c-torture/execute/pr111613.c


[gcc r12-10771] Fix modref's iteraction with store merging

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:65b67169fb1c641a11973988bd439e255d62131a

commit r12-10771-g65b67169fb1c641a11973988bd439e255d62131a
Author: Jan Hubicka 
Date:   Mon Jul 22 19:00:39 2024 +0200

Fix modref's iteraction with store merging

Hi,
this patch fixes wrong code in case store-merging introduces load of 
function
parameter that was previously write-only (which happens for bitfields).
Without this, the whole store-merged area is consdered to be killed.

PR ipa/111613

gcc/ChangeLog:

* ipa-modref.cc (analyze_parms): Do not preserve EAF_NO_DIRECT_READ 
and
EAF_NO_INDIRECT_READ from past flags.

gcc/testsuite/ChangeLog:

* gcc.c-torture/pr111613.c: New test.

(cherry picked from commit 14074773350ffed7efdebbc553adf0f23b572e87)

Diff:
---
 gcc/ipa-modref.cc  |  3 +++
 gcc/testsuite/gcc.c-torture/pr111613.c | 29 +
 2 files changed, 32 insertions(+)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 1d954954786f..ba7f21834ef9 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -3008,6 +3008,9 @@ analyze_parms (modref_summary *summary, 
modref_summary_lto *summary_lto,
 (past, ecf_flags,
  VOID_TYPE_P (TREE_TYPE
  (TREE_TYPE (current_function_decl;
+ /* Store merging can produce reads when combining together multiple
+bitfields.  See PR111613.  */
+ past &= ~(EAF_NO_DIRECT_READ | EAF_NO_INDIRECT_READ);
  if (dump_file && (flags | past) != flags && !(flags & EAF_UNUSED))
{
  fprintf (dump_file,
diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/pr111613.c
new file mode 100644
index ..1ea1c4dec072
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/pr111613.c
@@ -0,0 +1,29 @@
+#include 
+#include 
+
+struct bitfield {
+   unsigned int field1 : 1;
+   unsigned int field2 : 1;
+   unsigned int field3 : 1;
+};
+
+__attribute__((noinline)) static void
+set_field1_and_field2(struct bitfield *b) {
+   b->field1 = 1;
+   b->field2 = 1;
+}
+
+__attribute__((noinline)) static struct bitfield *
+new_bitfield(void) {
+   struct bitfield *b = (struct bitfield *)malloc(sizeof(*b));
+   b->field3 = 1;
+   set_field1_and_field2(b);
+   return b;
+}
+
+int main(void) {
+   struct bitfield *b = new_bitfield();
+   if (b->field3 != 1)
+   __builtin_abort ();
+   return 0;
+}


[gcc r12-10769] Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:92889011625f16e7eed654a137b9c14a29282917

commit r12-10769-g92889011625f16e7eed654a137b9c14a29282917
Author: Jan Hubicka 
Date:   Thu May 16 15:33:55 2024 +0200

Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

TARGET_MEM_REF can be used to offset constant base into a memory object (to
produce lea instruction).  This confuses 
points_to_local_or_readonly_memory_p
which treats the constant address as a base of the access.

Bootstrapped/regtsted x86_64-linux, comitted.
Honza

gcc/ChangeLog:

PR ipa/113787
* ipa-fnsummary.cc (points_to_local_or_readonly_memory_p): Do not
look into TARGET_MEM_REFS with constant opreand 0.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr113787.c: New test.

(cherry picked from commit 96d53252aefcbc2fe419c4c3b4bcd3fc03d4d187)

Diff:
---
 gcc/ipa-fnsummary.cc   |  4 ++-
 gcc/testsuite/gcc.c-torture/execute/pr113787.c | 38 ++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index b12e7a1124d5..65e6687428ee 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -2589,7 +2589,9 @@ points_to_local_or_readonly_memory_p (tree t)
return true;
   return !ptr_deref_may_alias_global_p (t, false);
 }
-  if (TREE_CODE (t) == ADDR_EXPR)
+  if (TREE_CODE (t) == ADDR_EXPR
+  && (TREE_CODE (TREE_OPERAND (t, 0)) != TARGET_MEM_REF
+ || TREE_CODE (TREE_OPERAND (TREE_OPERAND (t, 0), 0)) != INTEGER_CST))
 return refs_local_or_readonly_memory_p (TREE_OPERAND (t, 0));
   return false;
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr113787.c 
b/gcc/testsuite/gcc.c-torture/execute/pr113787.c
new file mode 100644
index ..702b6c35fc68
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr113787.c
@@ -0,0 +1,38 @@
+void foo(int x, int y, int z, int d, int *buf)
+{
+  for(int i = z; i < y-z; ++i)
+for(int j = 0; j < d; ++j)
+  /* buf[x(i+1) + j] = buf[x(i+1)-j-1] */
+  buf[i*x+(x-z+j)] = buf[i*x+(x-z-1-j)];
+}
+
+void bar(int x, int y, int z, int d, int *buf)
+{
+  for(int i = 0; i < d; ++i)
+for(int j = z; j < x-z; ++j)
+  /* buf[j+(y+i)*x] = buf[j+(y-1-i)*x] */
+  buf[j+(y-z+i)*x] = buf[j+(y-z-1-i)*x];
+}
+
+__attribute__((noipa))
+void baz(int x, int y, int d, int *buf)
+{
+  foo(x, y, 0, d, buf);
+  bar(x, y, 0, d, buf);
+}
+
+int main(void)
+{
+  int a[] = { 1, 2, 3 };
+  baz (1, 2, 1, a);
+  /* foo does:
+ buf[1] = buf[0];
+ buf[2] = buf[1];
+
+ bar does:
+ buf[2] = buf[1]; (no-op)
+ so we should have { 1, 1, 1 }.  */
+  for (int i = 0; i < 3; i++)
+if (a[i] != 1)
+  __builtin_abort ();
+}


[gcc r12-10770] Fix handling of ICF_NOVOPS in ipa-modref

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:b454ad0e4eb6bb38a6dfe15a43acb6792315640b

commit r12-10770-gb454ad0e4eb6bb38a6dfe15a43acb6792315640b
Author: Jan Hubicka 
Date:   Mon Jul 22 23:01:50 2024 +0200

Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of 
ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

Diff:
---
 gcc/ipa-modref.cc | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index bcd9b49fe631..1d954954786f 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -332,7 +332,7 @@ modref_summary::useful_p (int ecf_flags, bool check_flags)
   if (check_flags
   && remove_useless_eaf_flags (static_chain_flags, ecf_flags, false))
 return true;
-  if (ecf_flags & (ECF_CONST | ECF_NOVOPS))
+  if (ecf_flags & ECF_CONST)
 return ((!side_effects || !nondeterministic)
&& (ecf_flags & ECF_LOOPING_CONST_OR_PURE));
   if (loads && !loads->every_base)
@@ -1261,7 +1261,7 @@ modref_access_analysis::merge_call_side_effects
   int flags = gimple_call_flags (call);
 
   /* Nothing to do for non-looping cont functions.  */
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 return false;
 
@@ -1274,7 +1274,7 @@ modref_access_analysis::merge_call_side_effects
   /* Merge side effects and non-determinism.
  PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (!m_summary->side_effects && callee_summary->side_effects)
@@ -1463,7 +1463,7 @@ modref_access_analysis::process_fnspec (gcall *call)
 
   /* PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE)
   || (cfun->can_throw_non_call_exceptions
  && stmt_could_throw_p (cfun, call)))
@@ -1602,12 +1602,12 @@ modref_access_analysis::analyze_call (gcall *stmt)
   print_gimple_stmt (dump_file, stmt, 0);
 }
 
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (dump_file)
fprintf (dump_file,
-" - ECF_CONST | ECF_NOVOPS, ignoring all stores and all loads "
+" - ECF_CONST, ignoring all stores and all loads "
 "except for args.\n");
   return;
 }
@@ -1622,7 +1622,13 @@ modref_access_analysis::analyze_call (gcall *stmt)
   if (dump_file)
fprintf (dump_file, gimple_call_internal_p (stmt)
 ? " - Internal call" : " - Indirect call.\n");
-  process_fnspec (stmt);
+  if (flags & ECF_NOVOPS)
+{
+ set_side_effects ();
+ set_nondeterministic ();
+}
+  else
+   process_fnspec (stmt);
   return;
 }
   /* We only need to handle internal calls in IPA mode.  */
@@ -4510,7 +4516,7 @@ propagate_unknown_call (cgraph_node *node,
   return changed;
 }
 
-  if (!(ecf_flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(ecf_flags & (ECF_CONST | ECF_PURE))
   || (ecf_flags & ECF_LOOPING_CONST_OR_PURE)
   || nontrivial_scc)
 {
@@ -4724,7 +4730,7 @@ modref_propagate_in_scc (cgraph_node *component_node)
  struct cgraph_node *callee;
 
  if (!callee_edge->inline_failed
-|| ((flags & (ECF_CONST | ECF_NOVOPS))
+|| ((flags & ECF_CONST)
 && !(flags & ECF_LOOPING_CONST_OR_PURE)))
continue;
 
@@ -5147,8 +5153,8 @@ modref_propagate_flags_in_scc (cgraph_node 
*component_node)
{
  escape_summary *sum = escape_summaries->get (e);
 
- if (!sum || (e->indirect_info->ecf_flags
-  & (ECF_CONST | ECF_NOVOPS)))
+ if (!sum || ((e->in

[gcc r12-10767] Fix accounting of offsets in unadjusted_ptr_and_unit_offset

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:e098149b6b2c61ffe9e758dcd3ef021a78f2d132

commit r12-10767-ge098149b6b2c61ffe9e758dcd3ef021a78f2d132
Author: Jan Hubicka 
Date:   Mon Jul 22 18:05:26 2024 +0200

Fix accounting of offsets in unadjusted_ptr_and_unit_offset

unadjusted_ptr_and_unit_offset accidentally throws away the offset computed 
by
get_addr_base_and_unit_offset. Instead of passing extra_offset it passes 
offset.

PR ipa/114207

gcc/ChangeLog:

* ipa-prop.cc (unadjusted_ptr_and_unit_offset): Fix accounting of 
offsets in ADDR_EXPR.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr114207.c: New test.

(cherry picked from commit 391f46f10b0586c074014de82efe76787739bb0c)

Diff:
---
 gcc/ipa-prop.cc|  4 ++--
 gcc/testsuite/gcc.c-torture/execute/pr114207.c | 23 +++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index e2e83b5f3f50..848d62e49cf9 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -1263,9 +1263,9 @@ unadjusted_ptr_and_unit_offset (tree op, tree *ret, 
poly_int64 *offset_ret)
 {
   if (TREE_CODE (op) == ADDR_EXPR)
{
- poly_int64 extra_offset = 0;
+ poly_int64 extra_offset;
  tree base = get_addr_base_and_unit_offset (TREE_OPERAND (op, 0),
-&offset);
+&extra_offset);
  if (!base)
{
  base = get_base_address (TREE_OPERAND (op, 0));
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr114207.c 
b/gcc/testsuite/gcc.c-torture/execute/pr114207.c
new file mode 100644
index ..052fa85e9fc6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr114207.c
@@ -0,0 +1,23 @@
+#include 
+#include 
+
+struct S {
+int a, b;
+};
+
+__attribute__((noinline))
+void foo (struct S *s) {
+struct S ss = (struct S) {
+.a = s->b,
+.b = s->a
+};
+*s = ss;
+}
+
+int main() {
+  struct S s = {6, 12};
+  foo(&s);
+  if (s.a != 12 || s.b != 6)
+__builtin_abort ();
+  return 0;
+}


[gcc r12-10768] Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced to function call parameter

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:f2686f12e9345d95a2d6b7291bd777501d197869

commit r12-10768-gf2686f12e9345d95a2d6b7291bd777501d197869
Author: Jan Hubicka 
Date:   Mon Jul 22 18:08:08 2024 +0200

Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced 
to function call parameters

modref_eaf_analysis::analyze_ssa_name misinterprets EAF flags.  If 
dereferenced
parameter is passed (to map_iterator in the testcase) it can be returned
indirectly which in turn makes it to escape into the next function call.

PR ipa/115033

gcc/ChangeLog:

* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Fix 
checking of
EAF flags when analysing values dereferenced as function parameters.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr115033.c: New test.

(cherry picked from commit cf8ffc58aad3127031c229a75cc4b99c8ace25e0)

Diff:
---
 gcc/ipa-modref.cc  |  6 +++--
 gcc/testsuite/gcc.c-torture/execute/pr115033.c | 35 ++
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index c3e3fd50d173..bcd9b49fe631 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -2568,8 +2568,10 @@ modref_eaf_analysis::analyze_ssa_name (tree name, bool 
deferred)
int call_flags = deref_flags
(gimple_call_arg_flags (call, i), ignore_stores);
if (!ignore_retval && !(call_flags & EAF_UNUSED)
-   && !(call_flags & EAF_NOT_RETURNED_DIRECTLY)
-   && !(call_flags & EAF_NOT_RETURNED_INDIRECTLY))
+   && (call_flags & (EAF_NOT_RETURNED_DIRECTLY
+ | EAF_NOT_RETURNED_INDIRECTLY))
+   != (EAF_NOT_RETURNED_DIRECTLY
+   | EAF_NOT_RETURNED_INDIRECTLY))
  merge_call_lhs_flags (call, i, name, false, true);
if (ecf_flags & (ECF_CONST | ECF_NOVOPS))
  m_lattice[index].merge_direct_load ();
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr115033.c 
b/gcc/testsuite/gcc.c-torture/execute/pr115033.c
new file mode 100644
index ..3e79367d401c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr115033.c
@@ -0,0 +1,35 @@
+
+typedef struct func
+{
+  int *a;
+}func;
+__attribute__((noinline))
+void ff(struct func *t)
+{
+  *(t->a) = 0;
+}
+
+
+typedef struct mapped_iterator {
+  func F;
+}mapped_iterator;
+
+__attribute__((noinline))
+mapped_iterator map_iterator(func F) {
+  mapped_iterator t = {F};
+  return t;
+}
+
+void map_to_vector(func *F) {
+  mapped_iterator t = map_iterator(*F);
+  ff(&t.F);
+}
+int main() {
+  int resultIsStatic = 1;
+  func t ={&resultIsStatic};
+  map_to_vector(&t);
+
+  if (resultIsStatic)
+__builtin_trap();
+  __builtin_exit(0);
+}


[gcc r14-10787] Fix handling of ICF_NOVOPS in ipa-modref

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:f0629e32278ef3966c00e889d0c6dce1de6115cc

commit r14-10787-gf0629e32278ef3966c00e889d0c6dce1de6115cc
Author: Jan Hubicka 
Date:   Mon Jul 22 23:01:50 2024 +0200

Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of 
ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

Diff:
---
 gcc/ipa-modref.cc | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index ccf788e6398c..400a8856de2d 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -334,7 +334,7 @@ modref_summary::useful_p (int ecf_flags, bool check_flags)
   if (check_flags
   && remove_useless_eaf_flags (static_chain_flags, ecf_flags, false))
 return true;
-  if (ecf_flags & (ECF_CONST | ECF_NOVOPS))
+  if (ecf_flags & ECF_CONST)
 return ((!side_effects || !nondeterministic)
&& (ecf_flags & ECF_LOOPING_CONST_OR_PURE));
   if (loads && !loads->every_base)
@@ -1263,7 +1263,7 @@ modref_access_analysis::merge_call_side_effects
   int flags = gimple_call_flags (call);
 
   /* Nothing to do for non-looping cont functions.  */
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 return false;
 
@@ -1276,7 +1276,7 @@ modref_access_analysis::merge_call_side_effects
   /* Merge side effects and non-determinism.
  PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (!m_summary->side_effects && callee_summary->side_effects)
@@ -1465,7 +1465,7 @@ modref_access_analysis::process_fnspec (gcall *call)
 
   /* PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE)
   || (cfun->can_throw_non_call_exceptions
  && stmt_could_throw_p (cfun, call)))
@@ -1604,12 +1604,12 @@ modref_access_analysis::analyze_call (gcall *stmt)
   print_gimple_stmt (dump_file, stmt, 0);
 }
 
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (dump_file)
fprintf (dump_file,
-" - ECF_CONST | ECF_NOVOPS, ignoring all stores and all loads "
+" - ECF_CONST, ignoring all stores and all loads "
 "except for args.\n");
   return;
 }
@@ -1624,7 +1624,13 @@ modref_access_analysis::analyze_call (gcall *stmt)
   if (dump_file)
fprintf (dump_file, gimple_call_internal_p (stmt)
 ? " - Internal call" : " - Indirect call.\n");
-  process_fnspec (stmt);
+  if (flags & ECF_NOVOPS)
+{
+ set_side_effects ();
+ set_nondeterministic ();
+}
+  else
+   process_fnspec (stmt);
   return;
 }
   /* We only need to handle internal calls in IPA mode.  */
@@ -4570,7 +4576,7 @@ propagate_unknown_call (cgraph_node *node,
   return changed;
 }
 
-  if (!(ecf_flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(ecf_flags & (ECF_CONST | ECF_PURE))
   || (ecf_flags & ECF_LOOPING_CONST_OR_PURE)
   || nontrivial_scc)
 {
@@ -4784,7 +4790,7 @@ modref_propagate_in_scc (cgraph_node *component_node)
  struct cgraph_node *callee;
 
  if (!callee_edge->inline_failed
-|| ((flags & (ECF_CONST | ECF_NOVOPS))
+|| ((flags & ECF_CONST)
 && !(flags & ECF_LOOPING_CONST_OR_PURE)))
continue;
 
@@ -5207,8 +5213,8 @@ modref_propagate_flags_in_scc (cgraph_node 
*component_node)
{
  escape_summary *sum = escape_summaries->get (e);
 
- if (!sum || (e->indirect_info->ecf_flags
-  & (ECF_CONST | ECF_NOVOPS)))
+ if (!sum || ((e->in

[gcc r15-4055] testsuite: add missing braces around dejagnu directives

2024-10-04 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:a2b7a6fe28a695a7cb6791e072d55ad84dde16bd

commit r15-4055-ga2b7a6fe28a695a7cb6791e072d55ad84dde16bd
Author: Sam James 
Date:   Fri Oct 4 06:07:42 2024 +0100

testsuite: add missing braces around dejagnu directives

gcc/testsuite/ChangeLog:

* c-c++-common/analyzer/flex-without-call-summaries.c: Add missing 
brace.
* c-c++-common/analyzer/malloc-callbacks.c: Ditto.
* gcc.dg/Wstringop-overflow-79.c: Ditto.
* gcc.dg/Wstringop-overflow-80.c: Ditto.

Diff:
---
 .../analyzer/flex-without-call-summaries.c |  2 +-
 .../c-c++-common/analyzer/malloc-callbacks.c   |  2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-79.c   | 28 +++---
 gcc/testsuite/gcc.dg/Wstringop-overflow-80.c   | 28 +++---
 4 files changed, 30 insertions(+), 30 deletions(-)

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 092d78486219..e68ac2f3b749 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
@@ -889,7 +889,7 @@ static int yy_get_next_buffer (void)
}
else
/* Can't grow it, we don't own it. */
-   b->yy_ch_buf = NULL;  /* { dg-bogus "leak" "PR 
analyzer/103546"  */
+   b->yy_ch_buf = NULL;  /* { dg-bogus "leak" "PR 
analyzer/103546" } */
 
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
diff --git a/gcc/testsuite/c-c++-common/analyzer/malloc-callbacks.c 
b/gcc/testsuite/c-c++-common/analyzer/malloc-callbacks.c
index 0ba4f3824c62..422b40373634 100644
--- a/gcc/testsuite/c-c++-common/analyzer/malloc-callbacks.c
+++ b/gcc/testsuite/c-c++-common/analyzer/malloc-callbacks.c
@@ -64,7 +64,7 @@ void test_5 (void)
 {
   allocator_t alloc_fn = get_alloca ();
   deallocator_t dealloc_fn = get_free ();
-  int *ptr = (int *) alloc_fn (sizeof (int)); /* dg-message "region created on 
stack here" } */
+  int *ptr = (int *) alloc_fn (sizeof (int)); /* { dg-message "region created 
on stack here" } */
   dealloc_fn (ptr); /* { dg-warning "'free' of 'ptr' which points to memory on 
the stack" } */
 }
 
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c 
b/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
index 15eb26fbdb73..e97cb91ba18d 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
@@ -5,8 +5,8 @@
{ dg-do compile }
{ dg-options "-O0 -Wno-array-bounds" } */
 
-extern char a[8]; // dg-message at offset \\\[3, 6] into 
destination object 'a'" "note 1" }
-  // dg-message at offset \\\[5, 8] into 
destination object 'a'" "note 2" { target *-*-* } .-1 }
+extern char a[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'a'" "note 1" }
+  // { dg-message "at offset \\\[5, 8] into 
destination object 'a'" "note 2" { target *-*-* } .-1 }
 
 void test_2_notes (int i)
 {
@@ -15,9 +15,9 @@ void test_2_notes (int i)
 }
 
 
-extern char b[8]; // dg-message at offset \\\[3, 6] into 
destination object 'b'" "note 1" }
-  // dg-message at offset \\\[4, 7] into 
destination object 'b'" "note 2" { target *-*-* } .-1 }
-  // dg-message at offset \\\[5, 8] into 
destination object 'b'" "note 3" { target *-*-* } .-2 }
+extern char b[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'b'" "note 1" }
+  // { dg-message "at offset \\\[4, 7] into 
destination object 'b'" "note 2" { target *-*-* } .-1 }
+  // { dg-message "at offset \\\[5, 8] into 
destination object 'b'" "note 3" { target *-*-* } .-2 }
 
 void test_3_notes (int i)
 {
@@ -26,10 +26,10 @@ void test_3_notes (int i)
 }
 
 
-extern char c[8]; // dg-message at offset \\\[3, 6] into 
destination object 'c'" "note 1" }
-  // dg-message at offset \\\[4, 7] into 
destination object 'c'" "note 2" { target *-*-* } .-1 }
-  // dg-message at offset \\\[5, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
-  // dg-message at offset \\\[6, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
+extern char c[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'c'" "note 1" }
+  // { dg-message "at offset \\\[4, 7] into 
destination object 'c'" "note 2" { target *-*-* } .-1 }
+  // { dg-message "at offset \\\[5, 8] into 
destination obje

[gcc r15-4056] testsuite: fix two newly-running -Wstringop-overflow test directives

2024-10-04 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:0fae155090f2ce77fe876b2d16059dbeac6ded6e

commit r15-4056-g0fae155090f2ce77fe876b2d16059dbeac6ded6e
Author: Sam James 
Date:   Fri Oct 4 07:47:54 2024 +0100

testsuite: fix two newly-running -Wstringop-overflow test directives

This didn't show up until the previous commit which fixed the directive
syntax. The indexing was off for the notes.

gcc/testsuite/ChangeLog:

* gcc.dg/Wstringop-overflow-79.c: Fix index for notes.
* gcc.dg/Wstringop-overflow-80.c: Ditto.

Diff:
---
 gcc/testsuite/gcc.dg/Wstringop-overflow-79.c | 6 +++---
 gcc/testsuite/gcc.dg/Wstringop-overflow-80.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c 
b/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
index e97cb91ba18d..87bf775c0b2b 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-79.c
@@ -29,7 +29,7 @@ void test_3_notes (int i)
 extern char c[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'c'" "note 1" }
   // { dg-message "at offset \\\[4, 7] into 
destination object 'c'" "note 2" { target *-*-* } .-1 }
   // { dg-message "at offset \\\[5, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
-  // { dg-message "at offset \\\[6, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
+  // { dg-message "at offset \\\[6, 8] into 
destination object 'c'" "note 4" { target *-*-* } .-3 }
 
 void test_4_notes (int i)
 {
@@ -50,8 +50,8 @@ void test_4_notes (int i)
 extern char d[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'd'" "note 1" }
   // { dg-message "at offset \\\[4, 7] into 
destination object 'd'" "note 2" { target *-*-* } .-1 }
   // { dg-message "at offset \\\[5, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-2 }
-  // { dg-message "at offset \\\[6, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-3 }
-  // { dg-message "at offset \\\[7, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-4 }
+  // { dg-message "at offset \\\[6, 8] into 
destination object 'd'" "note 4" { target *-*-* } .-3 }
+  // { dg-message "at offset \\\[7, 8] into 
destination object 'd'" "note 5" { target *-*-* } .-4 }
 
 void test_5_notes (int i)
 {
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-80.c 
b/gcc/testsuite/gcc.dg/Wstringop-overflow-80.c
index c74ca3a7918b..f49b5ffc636b 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-80.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-80.c
@@ -29,7 +29,7 @@ void test_3_notes (int i)
 extern char c[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'c'" "note 1" }
   // { dg-message "at offset \\\[4, 7] into 
destination object 'c'" "note 2" { target *-*-* } .-1 }
   // { dg-message "at offset \\\[5, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
-  // { dg-message "at offset \\\[6, 8] into 
destination object 'c'" "note 3" { target *-*-* } .-2 }
+  // { dg-message "at offset \\\[6, 8] into 
destination object 'c'" "note 4" { target *-*-* } .-3 }
 
 void test_4_notes (int i)
 {
@@ -50,8 +50,8 @@ void test_4_notes (int i)
 extern char d[8]; // { dg-message "at offset \\\[3, 6] into 
destination object 'd'" "note 1" }
   // { dg-message "at offset \\\[4, 7] into 
destination object 'd'" "note 2" { target *-*-* } .-1 }
   // { dg-message "at offset \\\[5, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-2 }
-  // { dg-message "at offset \\\[6, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-3 }
-  // { dg-message "at offset \\\[7, 8] into 
destination object 'd'" "note 3" { target *-*-* } .-4 }
+  // { dg-message "at offset \\\[6, 8] into 
destination object 'd'" "note 4" { target *-*-* } .-3 }
+  // { dg-message "at offset \\\[7, 8] into 
destination object 'd'" "note 5" { target *-*-* } .-4 }
 
 void test_5_notes (int i)
 {


[gcc r15-4373] sparc: drop -mlra

2024-10-16 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:b388f65abc71c951167175aa502476f1bfaa2a83

commit r15-4373-gb388f65abc71c951167175aa502476f1bfaa2a83
Author: Sam James 
Date:   Mon Oct 14 11:53:52 2024 -0700

sparc: drop -mlra

The sparc port gained LRA support in r7-5076-gf99bd883fb0d05 and has
defaulted to LRA since r7-5642-g70a6dbe7e37e69.

Let's finish the transition by dropping -mlra entirely.

Tested on sparc64-unknown-linux-gnu with no regressions.

gcc/ChangeLog:
PR target/113952
* config/sparc/sparc.cc (sparc_lra_p): Delete.
(TARGET_LRA_P): Ditto.
(sparc_option_override): Don't use MASK_LRA.
* config/sparc/sparc.md (disabled,enabled): Drop lra attribute.
* config/sparc/sparc.opt: Delete -mlra.
* config/sparc/sparc.opt.urls: Ditto.
* doc/invoke.texi (SPARC options): Drop -mlra and -mno-lra.

Diff:
---
 gcc/config/sparc/sparc.cc   | 16 
 gcc/config/sparc/sparc.md   | 15 ---
 gcc/config/sparc/sparc.opt  |  4 
 gcc/config/sparc/sparc.opt.urls |  3 ---
 gcc/doc/invoke.texi | 10 +-
 5 files changed, 5 insertions(+), 43 deletions(-)

diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 4bc249da825e..353837d73e55 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -697,7 +697,6 @@ static const char *sparc_mangle_type (const_tree);
 static void sparc_trampoline_init (rtx, tree, rtx);
 static machine_mode sparc_preferred_simd_mode (scalar_mode);
 static reg_class_t sparc_preferred_reload_class (rtx x, reg_class_t rclass);
-static bool sparc_lra_p (void);
 static bool sparc_print_operand_punct_valid_p (unsigned char);
 static void sparc_print_operand (FILE *, rtx, int);
 static void sparc_print_operand_address (FILE *, machine_mode, rtx);
@@ -921,9 +920,6 @@ char sparc_hard_reg_printed[8];
 #define TARGET_MANGLE_TYPE sparc_mangle_type
 #endif
 
-#undef TARGET_LRA_P
-#define TARGET_LRA_P sparc_lra_p
-
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P sparc_legitimate_address_p
 
@@ -1957,10 +1953,6 @@ sparc_option_override (void)
   if (TARGET_ARCH32)
 target_flags &= ~MASK_STACK_BIAS;
 
-  /* Use LRA instead of reload, unless otherwise instructed.  */
-  if (!(target_flags_explicit & MASK_LRA))
-target_flags |= MASK_LRA;
-
   /* Enable applicable errata workarounds for LEON3FT.  */
   if (sparc_fix_ut699 || sparc_fix_ut700 || sparc_fix_gr712rc)
 {
@@ -13286,14 +13278,6 @@ sparc_preferred_reload_class (rtx x, reg_class_t 
rclass)
   return rclass;
 }
 
-/* Return true if we use LRA instead of reload pass.  */
-
-static bool
-sparc_lra_p (void)
-{
-  return TARGET_LRA;
-}
-
 /* Output a wide multiply instruction in V8+ mode.  INSN is the instruction,
OPERANDS are its operands and OPCODE is the mnemonic to be used.  */
 
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 736307926f9a..96c542c6ab6e 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -265,12 +265,8 @@
 (define_attr "cpu_feature" "none,fpu,fpunotv9,v9,vis,vis3,vis4,vis4b"
   (const_string "none"))
 
-(define_attr "lra" "disabled,enabled"
-  (const_string "enabled"))
-
 (define_attr "enabled" ""
-  (cond [(eq_attr "cpu_feature" "none")
-   (cond [(eq_attr "lra" "disabled") (symbol_ref "!TARGET_LRA")] 
(const_int 1))
+  (cond [(eq_attr "cpu_feature" "none") (const_int 1)
  (eq_attr "cpu_feature" "fpu") (symbol_ref "TARGET_FPU")
  (eq_attr "cpu_feature" "fpunotv9") (symbol_ref "TARGET_FPU && 
!TARGET_V9")
  (eq_attr "cpu_feature" "v9") (symbol_ref "TARGET_V9")
@@ -1867,8 +1863,7 @@ visl")
(set_attr "subtype" 
"*,*,regular,*,regular,*,*,*,*,*,*,*,*,*,*,*,*,*,double,double")
(set_attr "length" "*,2,*,*,*,*,2,2,*,*,2,2,*,2,2,2,*,*,*,*")
(set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*,*,*,*,double,double")
-   (set_attr "cpu_feature" 
"v9,*,*,*,*,*,*,*,fpu,fpu,fpu,fpu,v9,fpunotv9,vis3,vis3,fpu,fpu,vis,vis")
-   (set_attr "lra" "*,*,disabled,disabled,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*")])
+   (set_attr "cpu_feature" 
"v9,*,*,*,*,*,*,*,fpu,fpu,fpu,fpu,v9,fpunotv9,vis3,vis3,fpu,fpu,vis,vis")])
 
 (define_insn "*movdi_insn_sp64"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r, m, r,*e,?*e,?*e,  
m,b,b")
@@ -2496,8 +2491,7 @@ visl")
(set_attr "subtype" 
"*,*,double,double,*,*,*,*,*,*,regular,*,*,*,*,regular,*")
(set_attr "length" "*,2,*,*,*,2,2,2,*,*,*,*,2,2,2,*,*")
(set_attr "fptype" "*,*,double,double,double,*,*,*,*,*,*,*,*,*,*,*,*")
-   (set_attr "cpu_feature" 
"v9,*,vis,vis,v9,fpunotv9,vis3,vis3,fpu,fpu,*,*,fpu,fpu,*,*,*")
-   (set_attr "lra" "*,*,*,*,*,*,*,*,*,*,disabled,disabled,*,*,*,*,*")])
+   (set_attr "cpu_feature" 
"v9,*,vis,vis,v9,fpunotv9,vis3,vis3,fpu,fpu,*,*,fpu,fpu,*,*,*")])
 
 (define_insn "*movdf_insn_sp64"
   [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,*r, e,  e,m,

[gcc r15-4374] vax: fixup vax.opt.urls

2024-10-16 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:a9e14d2ddf200f612b5991dbf3a3218c08e31d08

commit r15-4374-ga9e14d2ddf200f612b5991dbf3a3218c08e31d08
Author: Sam James 
Date:   Wed Oct 16 09:16:55 2024 +0100

vax: fixup vax.opt.urls

Needed after r15-4373-gb388f65abc71c9.

gcc/ChangeLog:

* config/vax/vax.opt.urls: Adjust index for -mlra.

Diff:
---
 gcc/config/vax/vax.opt.urls | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/vax/vax.opt.urls b/gcc/config/vax/vax.opt.urls
index 10bee25d8336..7813b886baa2 100644
--- a/gcc/config/vax/vax.opt.urls
+++ b/gcc/config/vax/vax.opt.urls
@@ -19,5 +19,5 @@ munix
 UrlSuffix(gcc/VAX-Options.html#index-munix)
 
 mlra
-UrlSuffix(gcc/VAX-Options.html#index-mlra-4)
+UrlSuffix(gcc/VAX-Options.html#index-mlra-3)


[gcc r15-4051] testsuite: gnat.dg: fix dg-do directive syntax

2024-10-03 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:68d88d9b68f5b8a952ded65607af32f9244c8d87

commit r15-4051-g68d88d9b68f5b8a952ded65607af32f9244c8d87
Author: Sam James 
Date:   Fri Oct 4 03:15:28 2024 +0100

testsuite: gnat.dg: fix dg-do directive syntax

Fix incorrect use of '[' rather than '{' in 'dg-...' directives.

gcc/testsuite/ChangeLog:

* gnat.dg/pack13.adb: Fix 'dg-...' directive syntax.
* gnat.dg/size_attribute.adb: Ditto.
* gnat.dg/subp_elim_errors.adb: Ditto.

Diff:
---
 gcc/testsuite/gnat.dg/pack13.adb   | 2 +-
 gcc/testsuite/gnat.dg/size_attribute.adb   | 2 +-
 gcc/testsuite/gnat.dg/subp_elim_errors.adb | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gnat.dg/pack13.adb b/gcc/testsuite/gnat.dg/pack13.adb
index dd9cb09cf7b6..6581a53f9987 100644
--- a/gcc/testsuite/gnat.dg/pack13.adb
+++ b/gcc/testsuite/gnat.dg/pack13.adb
@@ -1,4 +1,4 @@
--- [ dg-do compile }
+-- { dg-do compile }
 
 package body Pack13 is
 
diff --git a/gcc/testsuite/gnat.dg/size_attribute.adb 
b/gcc/testsuite/gnat.dg/size_attribute.adb
index 25642e0b0aad..ec655f67a868 100644
--- a/gcc/testsuite/gnat.dg/size_attribute.adb
+++ b/gcc/testsuite/gnat.dg/size_attribute.adb
@@ -1,5 +1,5 @@
 -- PR middle-end/35823
--- { dg-do compile ]
+-- { dg-do compile }
 
 procedure Size_Attribute (Arg : in String) is
Size : constant Natural := Arg'Size;
diff --git a/gcc/testsuite/gnat.dg/subp_elim_errors.adb 
b/gcc/testsuite/gnat.dg/subp_elim_errors.adb
index 669e8772117e..1b8c3f23054d 100644
--- a/gcc/testsuite/gnat.dg/subp_elim_errors.adb
+++ b/gcc/testsuite/gnat.dg/subp_elim_errors.adb
@@ -1,4 +1,4 @@
--- [ dg-do compile }
+-- { dg-do compile }
 
 with System;


[gcc r15-4052] gcc: fix typo in gimplify

2024-10-03 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:4f0026c26fe0a24a44187cb376a819c6fd976c97

commit r15-4052-g4f0026c26fe0a24a44187cb376a819c6fd976c97
Author: Sam James 
Date:   Thu Oct 3 02:47:55 2024 +0100

gcc: fix typo in gimplify

gcc/ChangeLog:

* gimplify.cc (gimple_add_init_for_auto_var): Fix 'variable' typo.

Diff:
---
 gcc/gimplify.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index ceb53e5d5bb7..dd7efa71b742 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -2019,7 +2019,7 @@ gimple_add_init_for_auto_var (tree decl,
   gimplify_assign (decl, call, seq_p);
 }
 
-/* Generate padding initialization for automatic vairable DECL.
+/* Generate padding initialization for automatic variable DECL.
C guarantees that brace-init with fewer initializers than members
aggregate will initialize the rest of the aggregate as-if it were
static initialization.  In turn static initialization guarantees


[gcc r13-9112] Fix handling of ICF_NOVOPS in ipa-modref

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d5b42d1aa0cdfc11dc400ce66fcd4d13f8622b57

commit r13-9112-gd5b42d1aa0cdfc11dc400ce66fcd4d13f8622b57
Author: Jan Hubicka 
Date:   Mon Jul 22 23:01:50 2024 +0200

Fix handling of ICF_NOVOPS in ipa-modref

As shown in somewhat convoluted testcase, ipa-modref is mistreating
ECF_NOVOPS as "having no side effects".  This come from time when
modref cared only about memory accesses and thus it was possible to
shortcut on it.

This patch removes (hopefully) all those bad shortcuts.
Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

PR ipa/109985

* ipa-modref.cc (modref_summary::useful_p): Fix handling of 
ECF_NOVOPS.
(modref_access_analysis::process_fnspec): Likevise.
(modref_access_analysis::analyze_call): Likevise.
(propagate_unknown_call): Likevise.
(modref_propagate_in_scc): Likevise.
(modref_propagate_flags_in_scc): Likewise.
(ipa_merge_modref_summary_after_inlining): Likewise.

(cherry picked from commit efcbe7b985e24ac002a863afd609c44a67761195)

Diff:
---
 gcc/ipa-modref.cc | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index d62a5703a21b..c98e38524dfb 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -332,7 +332,7 @@ modref_summary::useful_p (int ecf_flags, bool check_flags)
   if (check_flags
   && remove_useless_eaf_flags (static_chain_flags, ecf_flags, false))
 return true;
-  if (ecf_flags & (ECF_CONST | ECF_NOVOPS))
+  if (ecf_flags & ECF_CONST)
 return ((!side_effects || !nondeterministic)
&& (ecf_flags & ECF_LOOPING_CONST_OR_PURE));
   if (loads && !loads->every_base)
@@ -1261,7 +1261,7 @@ modref_access_analysis::merge_call_side_effects
   int flags = gimple_call_flags (call);
 
   /* Nothing to do for non-looping cont functions.  */
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 return false;
 
@@ -1274,7 +1274,7 @@ modref_access_analysis::merge_call_side_effects
   /* Merge side effects and non-determinism.
  PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (!m_summary->side_effects && callee_summary->side_effects)
@@ -1463,7 +1463,7 @@ modref_access_analysis::process_fnspec (gcall *call)
 
   /* PURE/CONST flags makes functions deterministic and if there is
  no LOOPING_CONST_OR_PURE they also have no side effects.  */
-  if (!(flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(flags & (ECF_CONST | ECF_PURE))
   || (flags & ECF_LOOPING_CONST_OR_PURE)
   || (cfun->can_throw_non_call_exceptions
  && stmt_could_throw_p (cfun, call)))
@@ -1602,12 +1602,12 @@ modref_access_analysis::analyze_call (gcall *stmt)
   print_gimple_stmt (dump_file, stmt, 0);
 }
 
-  if ((flags & (ECF_CONST | ECF_NOVOPS))
+  if ((flags & ECF_CONST)
   && !(flags & ECF_LOOPING_CONST_OR_PURE))
 {
   if (dump_file)
fprintf (dump_file,
-" - ECF_CONST | ECF_NOVOPS, ignoring all stores and all loads "
+" - ECF_CONST, ignoring all stores and all loads "
 "except for args.\n");
   return;
 }
@@ -1622,7 +1622,13 @@ modref_access_analysis::analyze_call (gcall *stmt)
   if (dump_file)
fprintf (dump_file, gimple_call_internal_p (stmt)
 ? " - Internal call" : " - Indirect call.\n");
-  process_fnspec (stmt);
+  if (flags & ECF_NOVOPS)
+{
+ set_side_effects ();
+ set_nondeterministic ();
+}
+  else
+   process_fnspec (stmt);
   return;
 }
   /* We only need to handle internal calls in IPA mode.  */
@@ -4514,7 +4520,7 @@ propagate_unknown_call (cgraph_node *node,
   return changed;
 }
 
-  if (!(ecf_flags & (ECF_CONST | ECF_NOVOPS | ECF_PURE))
+  if (!(ecf_flags & (ECF_CONST | ECF_PURE))
   || (ecf_flags & ECF_LOOPING_CONST_OR_PURE)
   || nontrivial_scc)
 {
@@ -4728,7 +4734,7 @@ modref_propagate_in_scc (cgraph_node *component_node)
  struct cgraph_node *callee;
 
  if (!callee_edge->inline_failed
-|| ((flags & (ECF_CONST | ECF_NOVOPS))
+|| ((flags & ECF_CONST)
 && !(flags & ECF_LOOPING_CONST_OR_PURE)))
continue;
 
@@ -5151,8 +5157,8 @@ modref_propagate_flags_in_scc (cgraph_node 
*component_node)
{
  escape_summary *sum = escape_summaries->get (e);
 
- if (!sum || (e->indirect_info->ecf_flags
-  & (ECF_CONST | ECF_NOVOPS)))
+ if (!sum || ((e->ind

[gcc r13-9110] Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced to function call parameter

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:55b3fc2ab64594c4ac50925ce3d3cfdbb2a53374

commit r13-9110-g55b3fc2ab64594c4ac50925ce3d3cfdbb2a53374
Author: Jan Hubicka 
Date:   Mon Jul 22 18:08:08 2024 +0200

Fix modref_eaf_analysis::analyze_ssa_name handling of values dereferenced 
to function call parameters

modref_eaf_analysis::analyze_ssa_name misinterprets EAF flags.  If 
dereferenced
parameter is passed (to map_iterator in the testcase) it can be returned
indirectly which in turn makes it to escape into the next function call.

PR ipa/115033

gcc/ChangeLog:

* ipa-modref.cc (modref_eaf_analysis::analyze_ssa_name): Fix 
checking of
EAF flags when analysing values dereferenced as function parameters.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr115033.c: New test.

(cherry picked from commit cf8ffc58aad3127031c229a75cc4b99c8ace25e0)

Diff:
---
 gcc/ipa-modref.cc  |  6 +++--
 gcc/testsuite/gcc.c-torture/execute/pr115033.c | 35 ++
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 4ec2c7979f1e..d62a5703a21b 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -2569,8 +2569,10 @@ modref_eaf_analysis::analyze_ssa_name (tree name, bool 
deferred)
int call_flags = deref_flags
(gimple_call_arg_flags (call, i), ignore_stores);
if (!ignore_retval && !(call_flags & EAF_UNUSED)
-   && !(call_flags & EAF_NOT_RETURNED_DIRECTLY)
-   && !(call_flags & EAF_NOT_RETURNED_INDIRECTLY))
+   && (call_flags & (EAF_NOT_RETURNED_DIRECTLY
+ | EAF_NOT_RETURNED_INDIRECTLY))
+   != (EAF_NOT_RETURNED_DIRECTLY
+   | EAF_NOT_RETURNED_INDIRECTLY))
  merge_call_lhs_flags (call, i, name, false, true);
if (ecf_flags & (ECF_CONST | ECF_NOVOPS))
  m_lattice[index].merge_direct_load ();
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr115033.c 
b/gcc/testsuite/gcc.c-torture/execute/pr115033.c
new file mode 100644
index ..3e79367d401c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr115033.c
@@ -0,0 +1,35 @@
+
+typedef struct func
+{
+  int *a;
+}func;
+__attribute__((noinline))
+void ff(struct func *t)
+{
+  *(t->a) = 0;
+}
+
+
+typedef struct mapped_iterator {
+  func F;
+}mapped_iterator;
+
+__attribute__((noinline))
+mapped_iterator map_iterator(func F) {
+  mapped_iterator t = {F};
+  return t;
+}
+
+void map_to_vector(func *F) {
+  mapped_iterator t = map_iterator(*F);
+  ff(&t.F);
+}
+int main() {
+  int resultIsStatic = 1;
+  func t ={&resultIsStatic};
+  map_to_vector(&t);
+
+  if (resultIsStatic)
+__builtin_trap();
+  __builtin_exit(0);
+}


[gcc r13-9111] Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:63557666869a2857665df5b387240231a6f7e5fc

commit r13-9111-g63557666869a2857665df5b387240231a6f7e5fc
Author: Jan Hubicka 
Date:   Thu May 16 15:33:55 2024 +0200

Fix points_to_local_or_readonly_memory_p wrt TARGET_MEM_REF

TARGET_MEM_REF can be used to offset constant base into a memory object (to
produce lea instruction).  This confuses 
points_to_local_or_readonly_memory_p
which treats the constant address as a base of the access.

Bootstrapped/regtsted x86_64-linux, comitted.
Honza

gcc/ChangeLog:

PR ipa/113787
* ipa-fnsummary.cc (points_to_local_or_readonly_memory_p): Do not
look into TARGET_MEM_REFS with constant opreand 0.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr113787.c: New test.

(cherry picked from commit 96d53252aefcbc2fe419c4c3b4bcd3fc03d4d187)

Diff:
---
 gcc/ipa-fnsummary.cc   |  4 ++-
 gcc/testsuite/gcc.c-torture/execute/pr113787.c | 38 ++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index 63bd525b4c56..de9a6dd0c421 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -2572,7 +2572,9 @@ points_to_local_or_readonly_memory_p (tree t)
return true;
   return !ptr_deref_may_alias_global_p (t, false);
 }
-  if (TREE_CODE (t) == ADDR_EXPR)
+  if (TREE_CODE (t) == ADDR_EXPR
+  && (TREE_CODE (TREE_OPERAND (t, 0)) != TARGET_MEM_REF
+ || TREE_CODE (TREE_OPERAND (TREE_OPERAND (t, 0), 0)) != INTEGER_CST))
 return refs_local_or_readonly_memory_p (TREE_OPERAND (t, 0));
   return false;
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr113787.c 
b/gcc/testsuite/gcc.c-torture/execute/pr113787.c
new file mode 100644
index ..702b6c35fc68
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr113787.c
@@ -0,0 +1,38 @@
+void foo(int x, int y, int z, int d, int *buf)
+{
+  for(int i = z; i < y-z; ++i)
+for(int j = 0; j < d; ++j)
+  /* buf[x(i+1) + j] = buf[x(i+1)-j-1] */
+  buf[i*x+(x-z+j)] = buf[i*x+(x-z-1-j)];
+}
+
+void bar(int x, int y, int z, int d, int *buf)
+{
+  for(int i = 0; i < d; ++i)
+for(int j = z; j < x-z; ++j)
+  /* buf[j+(y+i)*x] = buf[j+(y-1-i)*x] */
+  buf[j+(y-z+i)*x] = buf[j+(y-z-1-i)*x];
+}
+
+__attribute__((noipa))
+void baz(int x, int y, int d, int *buf)
+{
+  foo(x, y, 0, d, buf);
+  bar(x, y, 0, d, buf);
+}
+
+int main(void)
+{
+  int a[] = { 1, 2, 3 };
+  baz (1, 2, 1, a);
+  /* foo does:
+ buf[1] = buf[0];
+ buf[2] = buf[1];
+
+ bar does:
+ buf[2] = buf[1]; (no-op)
+ so we should have { 1, 1, 1 }.  */
+  for (int i = 0; i < 3; i++)
+if (a[i] != 1)
+  __builtin_abort ();
+}


[gcc r13-9108] testsuite: fix PR111613 test

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:1a2725d346d382503c8d4f18f095fa8678b9f823

commit r13-9108-g1a2725d346d382503c8d4f18f095fa8678b9f823
Author: Sam James 
Date:   Mon Jul 29 21:47:16 2024 +0100

testsuite: fix PR111613 test

PR ipa/111613
* gcc.c-torture/pr111613.c: Rename to..
* gcc.c-torture/execute/pr111613.c: ...this.

(cherry picked from commit 5e5d7a88932b132437069f716160f8b20862890b)

Diff:
---
 gcc/testsuite/gcc.c-torture/{ => execute}/pr111613.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/execute/pr111613.c
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/pr111613.c
rename to gcc/testsuite/gcc.c-torture/execute/pr111613.c


[gcc r13-9109] Fix accounting of offsets in unadjusted_ptr_and_unit_offset

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:477e905d6f300b2354ece26a474c18a84a046b9e

commit r13-9109-g477e905d6f300b2354ece26a474c18a84a046b9e
Author: Jan Hubicka 
Date:   Mon Jul 22 18:05:26 2024 +0200

Fix accounting of offsets in unadjusted_ptr_and_unit_offset

unadjusted_ptr_and_unit_offset accidentally throws away the offset computed 
by
get_addr_base_and_unit_offset. Instead of passing extra_offset it passes 
offset.

PR ipa/114207

gcc/ChangeLog:

* ipa-prop.cc (unadjusted_ptr_and_unit_offset): Fix accounting of 
offsets in ADDR_EXPR.

gcc/testsuite/ChangeLog:

* gcc.c-torture/execute/pr114207.c: New test.

(cherry picked from commit 391f46f10b0586c074014de82efe76787739bb0c)

Diff:
---
 gcc/ipa-prop.cc|  4 ++--
 gcc/testsuite/gcc.c-torture/execute/pr114207.c | 23 +++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index 11ba2521b2c9..b4495dfb2732 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -1267,9 +1267,9 @@ unadjusted_ptr_and_unit_offset (tree op, tree *ret, 
poly_int64 *offset_ret)
 {
   if (TREE_CODE (op) == ADDR_EXPR)
{
- poly_int64 extra_offset = 0;
+ poly_int64 extra_offset;
  tree base = get_addr_base_and_unit_offset (TREE_OPERAND (op, 0),
-&offset);
+&extra_offset);
  if (!base)
{
  base = get_base_address (TREE_OPERAND (op, 0));
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr114207.c 
b/gcc/testsuite/gcc.c-torture/execute/pr114207.c
new file mode 100644
index ..052fa85e9fc6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr114207.c
@@ -0,0 +1,23 @@
+#include 
+#include 
+
+struct S {
+int a, b;
+};
+
+__attribute__((noinline))
+void foo (struct S *s) {
+struct S ss = (struct S) {
+.a = s->b,
+.b = s->a
+};
+*s = ss;
+}
+
+int main() {
+  struct S s = {6, 12};
+  foo(&s);
+  if (s.a != 12 || s.b != 6)
+__builtin_abort ();
+  return 0;
+}


[gcc r13-9107] Fix modref's iteraction with store merging

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:fefa09cb6a1afe0c16186bfc9c80f91e2d5aa5ba

commit r13-9107-gfefa09cb6a1afe0c16186bfc9c80f91e2d5aa5ba
Author: Jan Hubicka 
Date:   Mon Jul 22 19:00:39 2024 +0200

Fix modref's iteraction with store merging

Hi,
this patch fixes wrong code in case store-merging introduces load of 
function
parameter that was previously write-only (which happens for bitfields).
Without this, the whole store-merged area is consdered to be killed.

PR ipa/111613

gcc/ChangeLog:

* ipa-modref.cc (analyze_parms): Do not preserve EAF_NO_DIRECT_READ 
and
EAF_NO_INDIRECT_READ from past flags.

gcc/testsuite/ChangeLog:

* gcc.c-torture/pr111613.c: New test.

(cherry picked from commit 14074773350ffed7efdebbc553adf0f23b572e87)

Diff:
---
 gcc/ipa-modref.cc  |  3 +++
 gcc/testsuite/gcc.c-torture/pr111613.c | 29 +
 2 files changed, 32 insertions(+)

diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 795c4425ce37..4ec2c7979f1e 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -3001,6 +3001,9 @@ analyze_parms (modref_summary *summary, 
modref_summary_lto *summary_lto,
 (past, ecf_flags,
  VOID_TYPE_P (TREE_TYPE
  (TREE_TYPE (current_function_decl;
+ /* Store merging can produce reads when combining together multiple
+bitfields.  See PR111613.  */
+ past &= ~(EAF_NO_DIRECT_READ | EAF_NO_INDIRECT_READ);
  if (dump_file && (flags | past) != flags && !(flags & EAF_UNUSED))
{
  fprintf (dump_file,
diff --git a/gcc/testsuite/gcc.c-torture/pr111613.c 
b/gcc/testsuite/gcc.c-torture/pr111613.c
new file mode 100644
index ..1ea1c4dec072
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/pr111613.c
@@ -0,0 +1,29 @@
+#include 
+#include 
+
+struct bitfield {
+   unsigned int field1 : 1;
+   unsigned int field2 : 1;
+   unsigned int field3 : 1;
+};
+
+__attribute__((noinline)) static void
+set_field1_and_field2(struct bitfield *b) {
+   b->field1 = 1;
+   b->field2 = 1;
+}
+
+__attribute__((noinline)) static struct bitfield *
+new_bitfield(void) {
+   struct bitfield *b = (struct bitfield *)malloc(sizeof(*b));
+   b->field3 = 1;
+   set_field1_and_field2(b);
+   return b;
+}
+
+int main(void) {
+   struct bitfield *b = new_bitfield();
+   if (b->field3 != 1)
+   __builtin_abort ();
+   return 0;
+}


[gcc r13-9113] Use delete[] in int_range destructor [PR109920]

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6a372628228bf57d3e35cc1351650146a8d3febc

commit r13-9113-g6a372628228bf57d3e35cc1351650146a8d3febc
Author: Aldy Hernandez 
Date:   Mon May 22 21:03:05 2023 +0200

Use delete[] in int_range destructor [PR109920]

gcc/ChangeLog:

PR tree-optimization/109920
* value-range.h (RESIZABLE>::~int_range): Use delete[].

(cherry picked from commit 493a63af6cbab094c36a76435c12b1886328dab8)

Diff:
---
 gcc/value-range.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/value-range.h b/gcc/value-range.h
index 0284d6cedf4c..f859fe7e7a70 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -504,7 +504,7 @@ inline
 int_range::~int_range ()
 {
   if (RESIZABLE && m_base != m_ranges)
-delete m_base;
+delete[] m_base;
 }
 
 // This is an "infinite" precision irange for use in temporary


[gcc r13-9114] Remove buggy special case in irange::invert [PR109934].

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:a987affa2b10cd8a0b1d244d9f010746837e031c

commit r13-9114-ga987affa2b10cd8a0b1d244d9f010746837e031c
Author: Aldy Hernandez 
Date:   Tue May 23 12:34:45 2023 +0200

Remove buggy special case in irange::invert [PR109934].

This patch removes a buggy special case in irange::invert which seems
to have been broken for a while, and probably never triggered because
the legacy code was handled elsewhere, and the non-legacy code was
using an int_range_max of int_range<255> which made it extremely
likely for num_ranges == 255.  However, with auto-resizing ranges,
int_range_max will start off at 3 and can hit this bogus code in the
unswitching code.

PR tree-optimization/109934

gcc/ChangeLog:

* value-range.cc (irange::invert): Remove buggy special case.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr109934.c: New test.

(cherry picked from commit 8d5f050dabbf6dd3b992c3b46661848dbcf30d9e)

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/pr109934.c | 22 ++
 gcc/value-range.cc   |  8 
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c 
b/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c
new file mode 100644
index ..08bd5ce95c61
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c
@@ -0,0 +1,22 @@
+// { dg-do run }
+// { dg-options "-O3" }
+
+int printf(const char *, ...);
+short a;
+long b = 3, c;
+int d(int e) {
+  switch (e)
+  case 111:
+  case 222:
+  case 44:
+return 0;
+  return e;
+}
+int main() {
+  for (; a >= 0; --a)
+if (d(c + 23) - 23)
+  b = 0;
+
+  if (b != 3)
+__builtin_abort ();
+}
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 753f5e8cc769..1ac62e3018e1 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -2833,14 +2833,6 @@ irange::invert ()
   wide_int type_min = wi::min_value (prec, sign);
   wide_int type_max = wi::max_value (prec, sign);
   m_nonzero_mask = NULL;
-  if (m_num_ranges == m_max_ranges
-  && lower_bound () != type_min
-  && upper_bound () != type_max)
-{
-  m_base[1] = wide_int_to_tree (ttype, type_max);
-  m_num_ranges = 1;
-  return;
-}
 
   // At this point, we need one extra sub-range to represent the
   // inverse.


[gcc r12-10766] Remove buggy special case in irange::invert [PR109934].

2024-10-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ea7d7818fdc7a49be3d35acd441ce122e8bb477e

commit r12-10766-gea7d7818fdc7a49be3d35acd441ce122e8bb477e
Author: Aldy Hernandez 
Date:   Tue May 23 12:34:45 2023 +0200

Remove buggy special case in irange::invert [PR109934].

This patch removes a buggy special case in irange::invert which seems
to have been broken for a while, and probably never triggered because
the legacy code was handled elsewhere, and the non-legacy code was
using an int_range_max of int_range<255> which made it extremely
likely for num_ranges == 255.  However, with auto-resizing ranges,
int_range_max will start off at 3 and can hit this bogus code in the
unswitching code.

PR tree-optimization/109934

gcc/ChangeLog:

* value-range.cc (irange::invert): Remove buggy special case.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr109934.c: New test.

(cherry picked from commit 8d5f050dabbf6dd3b992c3b46661848dbcf30d9e)

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/pr109934.c | 22 ++
 gcc/value-range.cc   |  8 
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c 
b/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c
new file mode 100644
index ..08bd5ce95c61
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr109934.c
@@ -0,0 +1,22 @@
+// { dg-do run }
+// { dg-options "-O3" }
+
+int printf(const char *, ...);
+short a;
+long b = 3, c;
+int d(int e) {
+  switch (e)
+  case 111:
+  case 222:
+  case 44:
+return 0;
+  return e;
+}
+int main() {
+  for (; a >= 0; --a)
+if (d(c + 23) - 23)
+  b = 0;
+
+  if (b != 3)
+__builtin_abort ();
+}
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 000bbcf8917e..cf57e695e47e 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -1856,14 +1856,6 @@ irange::invert ()
   signop sign = TYPE_SIGN (ttype);
   wide_int type_min = wi::min_value (prec, sign);
   wide_int type_max = wi::max_value (prec, sign);
-  if (m_num_ranges == m_max_ranges
-  && lower_bound () != type_min
-  && upper_bound () != type_max)
-{
-  m_base[1] = wide_int_to_tree (ttype, type_max);
-  m_num_ranges = 1;
-  return;
-}
   // The algorithm is as follows.  To calculate INVERT ([a,b][c,d]), we
   // generate [-MIN, a-1][b+1, c-1][d+1, MAX].
   //


[gcc r15-4813] testsuite: fix c23-constexpr-2a.c test to use dg-do run

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2a4ee57b04398e54284e3d6b5ed4f8842ee26a5c

commit r15-4813-g2a4ee57b04398e54284e3d6b5ed4f8842ee26a5c
Author: Sam James 
Date:   Thu Oct 31 18:37:30 2024 +

testsuite: fix c23-constexpr-2a.c test to use dg-do run

The comment at the top of the test indicates it should be an execution test,
but it was only using 'dg-do link'. Correct that.

The only change in test results is as expected:
```
+PASS: gcc.dg/c23-constexpr-2a.c execution test
```

gcc/testsuite/ChangeLog:
PR testsuite/117183

* gcc.dg/c23-constexpr-2a.c: Use dg-do run.

Diff:
---
 gcc/testsuite/gcc.dg/c23-constexpr-2a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/c23-constexpr-2a.c 
b/gcc/testsuite/gcc.dg/c23-constexpr-2a.c
index a08097a126bd..3fe3756f379a 100644
--- a/gcc/testsuite/gcc.dg/c23-constexpr-2a.c
+++ b/gcc/testsuite/gcc.dg/c23-constexpr-2a.c
@@ -1,5 +1,5 @@
 /* Test C23 constexpr.  Valid code, execution test.  */
-/* { dg-do link } */
+/* { dg-do run } */
 /* { dg-options "-std=c23 -pedantic-errors" } */
 /* { dg-additional-sources "c23-constexpr-2b.c" } */


[gcc r15-4792] testsuite: fix syntax in Wstringop-overflow-59.c

2024-10-30 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2dcb174385fd366282bf34bf95adbf918d5befda

commit r15-4792-g2dcb174385fd366282bf34bf95adbf918d5befda
Author: Sam James 
Date:   Thu Oct 31 01:37:47 2024 +

testsuite: fix syntax in Wstringop-overflow-59.c

Fix quoting issues, escaping, and dg directive types.

There were two issues here:
1) The incorrect quoting in an earlier dg-message was covering up that the
syntax in the next part was wrong;
2) Fix dg-warning -> dg-message to correctly pick up the notes. Once 1) was
fixed, this was exposed.

With this, I get:
```
+PASS: gcc.dg/Wstringop-overflow-59.c note (test for warnings, line 192)
+PASS: gcc.dg/Wstringop-overflow-59.c note (test for warnings, line 193)
```

gcc/testsuite/ChangeLog:
PR middle-end/92936

* gcc.dg/Wstringop-overflow-59.c: Fix dg-* syntax.

Diff:
---
 gcc/testsuite/gcc.dg/Wstringop-overflow-59.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c 
b/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c
index b6265e37c865..88aac3a3678a 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-59.c
@@ -172,8 +172,8 @@ void memset_malloc_2_same_size (int i)
 if (i < 1)
   i = 1;
 
-char a4_1[4]; // { dg-message "at offset \\\[1, 4] into 
destination object 'a4_1" "note" }
-char a4_2[4]; // { dg-message "at offset \\\[1, 4] into 
destination object 'a4_2" "note" }
+char a4_1[4]; // { dg-message "at offset \\\[1, 4] into 
destination object 'a4_1'" "note" }
+char a4_2[4]; // { dg-message "at offset \\\[1, 4] into 
destination object 'a4_2'" "note" }
 char *p4 = cond1 ? a4_1 : a4_2;
 char *p4_i = p4 + i;
 
@@ -189,8 +189,8 @@ void memset_malloc_2_off (void)
   int i2 = SR (2, INT_MAX);
 
   {
-char a5[5];   // { dg-warning "at offset [1, 5] into 
destination object 'a5'
-char a7[7];   // { dg-warning "at offset [2, 7] into 
destination object 'a7'
+char a5[5];   // { dg-message "at offset \\\[1, 5] into 
destination object 'a5'" "note" }
+char a7[7];   // { dg-message "at offset \\\[2, 7] into 
destination object 'a7'" "note" }
 char *p5_p1 = a5 + i1;
 char *p7_p2 = a7 + i2;
 char *p5_7 = cond1 ? p5_p1 : p7_p2;


[gcc r15-4676] testsuite: add testcase for fixed PR115933

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:68e7ced1c7a9b205d3de5937d36ceab94fb44144

commit r15-4676-g68e7ced1c7a9b205d3de5937d36ceab94fb44144
Author: Sam James 
Date:   Sun Oct 20 08:28:59 2024 +0100

testsuite: add testcase for fixed PR115933

gcc/testsuite/ChangeLog:
PR rtl-optimization/115933

* gcc.dg/pr115933.c: New test.

Diff:
---
 gcc/testsuite/gcc.dg/pr115933.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/pr115933.c b/gcc/testsuite/gcc.dg/pr115933.c
new file mode 100644
index ..041597ae3309
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr115933.c
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/115933 */
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-tree-loop-optimize -ftree-vrp -fno-tree-ch -fgcse" } 
*/
+
+int a, b;
+unsigned c() {
+  int d, e = d = 2;
+  if (a < 0)
+for (e = 0; e < 1; e++)
+  d = 0;
+  b = e;
+  return d;
+}
+int main() {
+  c();
+  if (b != 2)
+__builtin_abort();
+  return 0;
+}


[gcc r15-4723] testsuite: add testcase for fixed PR107467

2024-10-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:4e09ae37dbe0a10f48490214f50ff733cc92280a

commit r15-4723-g4e09ae37dbe0a10f48490214f50ff733cc92280a
Author: Sam James 
Date:   Mon Oct 21 12:11:42 2024 +0100

testsuite: add testcase for fixed PR107467

PR107467 ended up being fixed by the fix for PR115110, but let's
add the testcase on top.

gcc/testsuite/ChangeLog:
PR tree-optimization/107467
PR middle-end/115110

* g++.dg/lto/pr107467_0.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr107467_0.C | 52 +++
 1 file changed, 52 insertions(+)

diff --git a/gcc/testsuite/g++.dg/lto/pr107467_0.C 
b/gcc/testsuite/g++.dg/lto/pr107467_0.C
new file mode 100644
index ..a871aca82459
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr107467_0.C
@@ -0,0 +1,52 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options {{ -O2 -fno-strict-aliasing -flto }} } */
+
+template 
+struct pair
+{
+int first;
+T second;
+};
+
+template 
+[[gnu::optimize("strict-aliasing")]]
+bool __attribute__((noinline))
+compare_pairs(const pair &lhs, const pair &rhs) {
+  return lhs.first == rhs.first && lhs.second == rhs.second;
+}
+
+template  struct Combined {
+  pair 
+__attribute__((noinline)) get_const() {
+return pair{123, nullptr};
+  }
+[[gnu::optimize("strict-aliasing")]]
+  bool 
+__attribute__((noinline)) clashy() {
+return compare_pairs(get_const(), get_const());
+  }
+};
+
+class SomeClass {};
+class OtherClass {};
+
+[[gnu::optimize("strict-aliasing")]]
+[[gnu::used]]
+void some_func() {
+  Combined myvar;
+  __builtin_printf("%i\n", myvar.clashy());
+}
+
+[[gnu::optimize("strict-aliasing")]]
+void other_func() {
+  Combined myvar;
+  int t = myvar.clashy();
+  if (!t)
+  __builtin_abort();
+}
+
+[[gnu::optimize("O0")]]
+int main()
+{
+  other_func();
+}


[gcc r14-10845] testsuite: add testcase for fixed PR107467

2024-10-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2f0d109bd871d11b5b93468f271aa6dc34ef88d8

commit r14-10845-g2f0d109bd871d11b5b93468f271aa6dc34ef88d8
Author: Sam James 
Date:   Mon Oct 21 12:11:42 2024 +0100

testsuite: add testcase for fixed PR107467

PR107467 ended up being fixed by the fix for PR115110, but let's
add the testcase on top.

gcc/testsuite/ChangeLog:
PR tree-optimization/107467
PR middle-end/115110

* g++.dg/lto/pr107467_0.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr107467_0.C | 52 +++
 1 file changed, 52 insertions(+)

diff --git a/gcc/testsuite/g++.dg/lto/pr107467_0.C 
b/gcc/testsuite/g++.dg/lto/pr107467_0.C
new file mode 100644
index ..a871aca82459
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr107467_0.C
@@ -0,0 +1,52 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options {{ -O2 -fno-strict-aliasing -flto }} } */
+
+template 
+struct pair
+{
+int first;
+T second;
+};
+
+template 
+[[gnu::optimize("strict-aliasing")]]
+bool __attribute__((noinline))
+compare_pairs(const pair &lhs, const pair &rhs) {
+  return lhs.first == rhs.first && lhs.second == rhs.second;
+}
+
+template  struct Combined {
+  pair 
+__attribute__((noinline)) get_const() {
+return pair{123, nullptr};
+  }
+[[gnu::optimize("strict-aliasing")]]
+  bool 
+__attribute__((noinline)) clashy() {
+return compare_pairs(get_const(), get_const());
+  }
+};
+
+class SomeClass {};
+class OtherClass {};
+
+[[gnu::optimize("strict-aliasing")]]
+[[gnu::used]]
+void some_func() {
+  Combined myvar;
+  __builtin_printf("%i\n", myvar.clashy());
+}
+
+[[gnu::optimize("strict-aliasing")]]
+void other_func() {
+  Combined myvar;
+  int t = myvar.clashy();
+  if (!t)
+  __builtin_abort();
+}
+
+[[gnu::optimize("O0")]]
+int main()
+{
+  other_func();
+}


[gcc r14-10847] testsuite: add testcase for fixed PR107467

2024-10-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6247aae35faaf04de48c5f3d9c4e4af6f7e3789c

commit r14-10847-g6247aae35faaf04de48c5f3d9c4e4af6f7e3789c
Author: Sam James 
Date:   Mon Oct 21 12:11:42 2024 +0100

testsuite: add testcase for fixed PR107467

PR107467 ended up being fixed by the fix for PR115110, but let's
add the testcase on top.

gcc/testsuite/ChangeLog:
PR tree-optimization/107467
PR middle-end/115110

* g++.dg/lto/pr107467_0.C: New test.

(cherry picked from commit 4e09ae37dbe0a10f48490214f50ff733cc92280a)

Diff:
---
 gcc/testsuite/g++.dg/lto/pr107467_0.C | 52 +++
 1 file changed, 52 insertions(+)

diff --git a/gcc/testsuite/g++.dg/lto/pr107467_0.C 
b/gcc/testsuite/g++.dg/lto/pr107467_0.C
new file mode 100644
index ..a871aca82459
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr107467_0.C
@@ -0,0 +1,52 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options {{ -O2 -fno-strict-aliasing -flto }} } */
+
+template 
+struct pair
+{
+int first;
+T second;
+};
+
+template 
+[[gnu::optimize("strict-aliasing")]]
+bool __attribute__((noinline))
+compare_pairs(const pair &lhs, const pair &rhs) {
+  return lhs.first == rhs.first && lhs.second == rhs.second;
+}
+
+template  struct Combined {
+  pair 
+__attribute__((noinline)) get_const() {
+return pair{123, nullptr};
+  }
+[[gnu::optimize("strict-aliasing")]]
+  bool 
+__attribute__((noinline)) clashy() {
+return compare_pairs(get_const(), get_const());
+  }
+};
+
+class SomeClass {};
+class OtherClass {};
+
+[[gnu::optimize("strict-aliasing")]]
+[[gnu::used]]
+void some_func() {
+  Combined myvar;
+  __builtin_printf("%i\n", myvar.clashy());
+}
+
+[[gnu::optimize("strict-aliasing")]]
+void other_func() {
+  Combined myvar;
+  int t = myvar.clashy();
+  if (!t)
+  __builtin_abort();
+}
+
+[[gnu::optimize("O0")]]
+int main()
+{
+  other_func();
+}


[gcc r14-10846] Revert "testsuite: add testcase for fixed PR107467"

2024-10-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ed8fb9b285d7706426ca54f7ffbf9d04f346af16

commit r14-10846-ged8fb9b285d7706426ca54f7ffbf9d04f346af16
Author: Sam James 
Date:   Mon Oct 28 17:06:37 2024 +

Revert "testsuite: add testcase for fixed PR107467"

This reverts commit 2f0d109bd871d11b5b93468f271aa6dc34ef88d8.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr107467_0.C | 52 ---
 1 file changed, 52 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr107467_0.C 
b/gcc/testsuite/g++.dg/lto/pr107467_0.C
deleted file mode 100644
index a871aca82459..
--- a/gcc/testsuite/g++.dg/lto/pr107467_0.C
+++ /dev/null
@@ -1,52 +0,0 @@
-/* { dg-lto-do run } */
-/* { dg-lto-options {{ -O2 -fno-strict-aliasing -flto }} } */
-
-template 
-struct pair
-{
-int first;
-T second;
-};
-
-template 
-[[gnu::optimize("strict-aliasing")]]
-bool __attribute__((noinline))
-compare_pairs(const pair &lhs, const pair &rhs) {
-  return lhs.first == rhs.first && lhs.second == rhs.second;
-}
-
-template  struct Combined {
-  pair 
-__attribute__((noinline)) get_const() {
-return pair{123, nullptr};
-  }
-[[gnu::optimize("strict-aliasing")]]
-  bool 
-__attribute__((noinline)) clashy() {
-return compare_pairs(get_const(), get_const());
-  }
-};
-
-class SomeClass {};
-class OtherClass {};
-
-[[gnu::optimize("strict-aliasing")]]
-[[gnu::used]]
-void some_func() {
-  Combined myvar;
-  __builtin_printf("%i\n", myvar.clashy());
-}
-
-[[gnu::optimize("strict-aliasing")]]
-void other_func() {
-  Combined myvar;
-  int t = myvar.clashy();
-  if (!t)
-  __builtin_abort();
-}
-
-[[gnu::optimize("O0")]]
-int main()
-{
-  other_func();
-}


[gcc r15-4724] gcc: fix 'statements' comment typo

2024-10-28 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ca078d260a13aaf644fc871675a127c44aa12ccc

commit r15-4724-gca078d260a13aaf644fc871675a127c44aa12ccc
Author: Sam James 
Date:   Mon Oct 28 18:24:14 2024 +

gcc: fix 'statements' comment typo

gcc/ChangeLog:

* opts-common.cc (prune_options): Fix typo.

Diff:
---
 gcc/opts-common.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc
index 22774457bf0f..ac2e77b16590 100644
--- a/gcc/opts-common.cc
+++ b/gcc/opts-common.cc
@@ -40,7 +40,7 @@ static void prune_options (struct cl_decoded_option **, 
unsigned int *);
example, we want -gno-statement-frontiers to be taken as a negation
of -gstatement-frontiers, but without catching the gno- prefix and
signaling it's to be used for option remapping, it would end up
-   backtracked to g with no-statemnet-frontiers as the debug level.  */
+   backtracked to g with no-statement-frontiers as the debug level.  */
 
 static bool
 remapping_prefix_p (const struct cl_option *opt)


[gcc r15-5076] doc: install: document UBSAN_OPTIONS

2024-11-10 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:00448f9b5a123b4b6b3e6f45d2fecf0a5dca66b3

commit r15-5076-g00448f9b5a123b4b6b3e6f45d2fecf0a5dca66b3
Author: Sam James 
Date:   Thu Oct 31 21:09:32 2024 +

doc: install: document UBSAN_OPTIONS

Explain that 'bootstrap-ubsan' won't abort on errors by default and how
to override that by setting UBSAN_OPTIONS.

gcc/ChangeLog:
PR other/116948

* doc/install.texi (Building a native compiler): Document 
UBSAN_OPTIONS.

Diff:
---
 gcc/doc/install.texi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index d1fc7220db9d..705440ffd330 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3149,7 +3149,9 @@ systems that are running Linux kernel version 5.4 or 
later.
 
 @item @samp{bootstrap-ubsan}
 Compiles GCC itself using Undefined Behavior Sanitization in order to catch
-undefined behavior within the GCC code.
+undefined behavior within the GCC code.  Note that it does not abort on errors
+by default.  @code{UBSAN_OPTIONS} can be set to change this, like
+@samp{UBSAN_OPTIONS='abort_on_error=1:halt_on_error=1:print_summary=1:print_stacktrace=1'}.
 
 @end table


[gcc r15-5075] doc: install: document bootstrap-ubsan

2024-11-10 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:8f791fac1419a5dc663abd5091cf4db409539b33

commit r15-5075-g8f791fac1419a5dc663abd5091cf4db409539b33
Author: Sam James 
Date:   Thu Oct 31 21:06:13 2024 +

doc: install: document bootstrap-ubsan

gcc/ChangeLog:
PR other/116948

* doc/install.texi (Building a native compiler): Mention 
bootstrap-ubsan.

Diff:
---
 gcc/doc/install.texi | 4 
 1 file changed, 4 insertions(+)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index b562b0f38d6c..d1fc7220db9d 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3147,6 +3147,10 @@ Compiles GCC itself using HWAddress Sanitization in 
order to catch invalid
 memory accesses within the GCC code.  This option is only available on AArch64
 systems that are running Linux kernel version 5.4 or later.
 
+@item @samp{bootstrap-ubsan}
+Compiles GCC itself using Undefined Behavior Sanitization in order to catch
+undefined behavior within the GCC code.
+
 @end table
 
 @section Building a cross compiler


[gcc r15-4683] testsuite: lto: rename pr47333 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:04e0fbbc34e1015f081676c6fc7c674cf0eeb1d5

commit r15-4683-g04e0fbbc34e1015f081676c6fc7c674cf0eeb1d5
Author: Sam James 
Date:   Fri Oct 25 16:31:01 2024 +0100

testsuite: lto: rename pr47333 test

This was being ignored previously. Rename it per README.

gcc/testsuite/ChangeLog:
PR target/47333

* g++.dg/lto/pr47333.C: Move to...
* g++.dg/lto/pr47333_0.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/lto/{pr47333.C => pr47333_0.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr47333.C 
b/gcc/testsuite/g++.dg/lto/pr47333_0.C
similarity index 100%
rename from gcc/testsuite/g++.dg/lto/pr47333.C
rename to gcc/testsuite/g++.dg/lto/pr47333_0.C


[gcc r15-4692] testsuite: fixup tbaa test again

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:40fedaf35fa99a9728d5b84d47035f4c92e1ba90

commit r15-4692-g40fedaf35fa99a9728d5b84d47035f4c92e1ba90
Author: Sam James 
Date:   Sat Oct 26 02:03:43 2024 +0100

testsuite: fixup tbaa test again

Test was broken until r15-4684-g2d1d6be00257c5 which made it actually
run and r15-4685-g091e45b4e97d1e which applied fixes other than the
trivial rename.

But more is needed: this gets the test working properly in terms of scanning
the dump and handling the interaction w/ LTO with not producing an 
executable
(did try ltrans scan but that didn't work either).

Unfortunately, the test seems to fail for me on godbolt even going back to
GCC 7.1 or thereabouts, hence XFAIL. However, if I revert 
r9-3870-g2a98b4bfc3d952,
I do get an ICE in fld_incomplete_type_of -- because we do far more checking
with LTO now on (in)complete types. And reverting it on releases/gcc-9 
actually
makes it give 0.

In summary: fix the test fully so it really does run and we get a check
for ICEing at least, and mark the dg-final scan as XFAIL so Honza can
comment on that.

gcc/testsuite/ChangeLog:
PR testsuite/117299

* gcc.dg/lto/tbaa_0.c: Move to...
* gcc.dg/tbaa.c: ...here.

Diff:
---
 gcc/testsuite/gcc.dg/{lto/tbaa_0.c => tbaa.c} | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/lto/tbaa_0.c b/gcc/testsuite/gcc.dg/tbaa.c
similarity index 77%
rename from gcc/testsuite/gcc.dg/lto/tbaa_0.c
rename to gcc/testsuite/gcc.dg/tbaa.c
index eb14ea62b896..b336622afd1a 100644
--- a/gcc/testsuite/gcc.dg/lto/tbaa_0.c
+++ b/gcc/testsuite/gcc.dg/tbaa.c
@@ -1,6 +1,6 @@
-/* { dg-lto-do link } */
-/* We need -flto=partition=none to get the dump file for scan-tree-dump-times. 
*/
-/* { dg-lto-options {{ -O2 -flto -flto-partition=none -fdump-tree-evrp 
-std=gnu89 }} } */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -flto -flto-partition=one -fdump-tree-evrp -std=gnu89" } 
*/
+/* { dg-require-effective-target lto } */
 
 typedef struct rtx_def *rtx;
 typedef struct cselib_val_struct
@@ -40,4 +40,4 @@ discard_useless_locs (x, info)
   n_useless_values++;
 }
 }
-/* { dg-final { scan-tree-dump-times "n_useless_values" 2 "evrp" } } */
+/* { dg-final { scan-tree-dump-times "n_useless_values" 2 "evrp" { xfail *-*-* 
} } } */


[gcc r15-4803] testsuite: add testcase for fixed PR106073

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:df09173e355f30089b97090b19c095907242b35e

commit r15-4803-gdf09173e355f30089b97090b19c095907242b35e
Author: Sam James 
Date:   Thu Oct 31 03:36:23 2024 +

testsuite: add testcase for fixed PR106073

This was fixed by r12-8835-ge8d5f3a1b5a583 which surely made it latent
but richi points out it was likely an instance of PR90348. -fstack-reuse
continues to be a menace, so let's add the testcase.

gcc/testsuite/ChangeLog:
PR middle-end/90348
PR tree-optimization/106073

* gcc.dg/pr106073.c: New test.

Diff:
---
 gcc/testsuite/gcc.dg/pr106073.c | 123 
 1 file changed, 123 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/pr106073.c b/gcc/testsuite/gcc.dg/pr106073.c
new file mode 100644
index ..570e68868b2d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr106073.c
@@ -0,0 +1,123 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+int a, f = 1, h, l, m = 1, o, r = 4, q, s, x, e, aa, ab, ac, *ad, ae = 5, **y, 
**af, ag, ah, ai, aj;
+static int c[6], d, g[6][5], n, *v = &s, ak;
+volatile int p;
+const volatile int al;
+static volatile int t, u, w = 3, z, am, an;
+static int ao();
+void ap();
+static void aq() {
+  int ar[4] = {6, 6, 6, 6}, as[1], i, j;
+  as[0] = 0;
+  if (m) {
+int at[11] = {4, 4, 6, 5, 7, 0, 7, 6, 7, 6, 6}, *au, *av[7], k;
+au = (int*) &au;
+for (i = 0; i < 1; i++)
+  for (j = 0; j < 1; j++)
+for (k = 0; k < 7; k++) {
+  (t || n) && u;
+  av[k] = 0;
+}
+y = av;
+while (o) {
+  int *b[2] = {as, ar};
+  *af = at;
+}
+m = 0;
+  }
+}
+inline void ap() {
+  for (; l <= 4; l++) {
+*v = 0;
+aq();
+if (a)
+  break;
+for (; q; q++)
+  ;
+  }
+}
+int ao() {
+  int be = 0, j;
+  if (n)
+aa = d = 0;
+  l = 0;
+  for (; be < 2; be++) {
+int bf[7][2];
+for (ai = 0; ai < 7; ai++)
+  for (j = 0; j < 2; j++)
+bf[ai][j] = 5;
+if (be) {
+  for (; h >= 0; h--) {
+while (z >= w) {
+  ap();
+  *ad = 0;
+}
+ap();
+  }
+  return bf[3][0];
+}
+if (bf[3][0])
+  continue;
+while (1)
+  ;
+  }
+  return 0;
+}
+static void aw() {
+  for (; ah; ah++) {
+p = 0;
+p = 0;
+  }
+  int ax = ~e;
+ L1:
+  e = a = 0;
+ L2:
+  if (!r)
+goto L3;
+  if (!ax)
+goto L2;
+  if (d)
+goto L1;
+  if (!ae)
+goto L1;
+  if (w && x <= 808 && f)
+ag = ao();
+  g[0][4] = ag;
+  if (a) {
+int bd;
+n++;
+while (n)
+  for (bd = 0; bd < 7; bd++) {
+am;
+am;
+am;
+am;
+d = c[d ^ am];
+  }
+  } else {
+  L3:
+an;
+for (; ak; ak++) {
+  int bc = 7;
+  for (; bc >= 0; bc--) {
+al;
+al;
+d = f && an;
+an;
+  }
+}
+  }
+}
+int main() {
+  int k;
+  for (; aj < 6; aj++)
+c[0] = aj;
+  aw();
+  for (aj = 0; aj < 6; aj++)
+for (k = 0; k < 5; k++)
+  d = c[d ^ g[aj][k]];
+  if (d != 5)
+__builtin_abort();
+  return 0;
+}


[gcc r15-4822] testsuite: g++.dg: rename pr42965 test

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6e58db990113ef756970a83de16754563076e701

commit r15-4822-g6e58db990113ef756970a83de16754563076e701
Author: Sam James 
Date:   Fri Oct 25 23:18:12 2024 +0100

testsuite: g++.dg: rename pr42965 test

.c is used for C and .C is for C++. The test was being ignored before.

gcc/testsuite/ChangeLog:
PR other/42965

* g++.dg/warn/unused-result1-Werror.c: Move to...
* g++.dg/warn/unused-result1-Werror.C: ...here.

Diff:
---
 .../g++.dg/warn/{unused-result1-Werror.c => unused-result1-Werror.C}  | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/warn/unused-result1-Werror.c 
b/gcc/testsuite/g++.dg/warn/unused-result1-Werror.C
similarity index 100%
rename from gcc/testsuite/g++.dg/warn/unused-result1-Werror.c
rename to gcc/testsuite/g++.dg/warn/unused-result1-Werror.C


[gcc r15-4821] testsuite: g++.dg: rename pr105820 test

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:31ec0b0360e2cae5cf927924713757ad7a7c669c

commit r15-4821-g31ec0b0360e2cae5cf927924713757ad7a7c669c
Author: Sam James 
Date:   Fri Oct 25 23:15:02 2024 +0100

testsuite: g++.dg: rename pr105820 test

.c is used for C and .C is for C++. The test was being ignored before.

gcc/testsuite/ChangeLog:
PR tree-optimization/105820

* g++.dg/tree-ssa/pr105820.c: Move to...
* g++.dg/tree-ssa/pr105820.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/tree-ssa/{pr105820.c => pr105820.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr105820.c 
b/gcc/testsuite/g++.dg/tree-ssa/pr105820.C
similarity index 100%
rename from gcc/testsuite/g++.dg/tree-ssa/pr105820.c
rename to gcc/testsuite/g++.dg/tree-ssa/pr105820.C


[gcc r15-4823] testsuite: g++.dg: rename pr66655 test

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:14e2f3233bf0ef27e3cbf28478c63c0335cf514c

commit r15-4823-g14e2f3233bf0ef27e3cbf28478c63c0335cf514c
Author: Sam James 
Date:   Tue Oct 29 05:32:39 2024 +

testsuite: g++.dg: rename pr66655 test

The test was being ignored because dg.exp looks for .C in g++.dg/.

gcc/testsuite/ChangeLog:
PR target/66655

* g++.dg/pr66655_1.cc: Move to...
* g++.dg/pr66655_1.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/{pr66655_1.cc => pr66655_1.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/pr66655_1.cc 
b/gcc/testsuite/g++.dg/pr66655_1.C
similarity index 100%
rename from gcc/testsuite/g++.dg/pr66655_1.cc
rename to gcc/testsuite/g++.dg/pr66655_1.C


[gcc r15-4824] testsuite: fixup pr66655.C

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:1ef0239da9dc5e3326ee5e928f2c5fe1bc2f4ffd

commit r15-4824-g1ef0239da9dc5e3326ee5e928f2c5fe1bc2f4ffd
Author: Sam James 
Date:   Fri Nov 1 00:03:34 2024 +

testsuite: fixup pr66655.C

In r15-4823-g14e2f3233bf0ef, I renamed pr66655_1.cc but neglected
to update a dg-additional-sources reference.

gcc/testsuite/ChangeLog:
PR target/66655

* g++.dg/pr66655.C: Adjust filename in dg-additional-sources.

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

diff --git a/gcc/testsuite/g++.dg/pr66655.C b/gcc/testsuite/g++.dg/pr66655.C
index e4a40b02912d..2ae4c4e22f88 100644
--- a/gcc/testsuite/g++.dg/pr66655.C
+++ b/gcc/testsuite/g++.dg/pr66655.C
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-additional-sources "pr66655_1.cc" } */
+/* { dg-additional-sources "pr66655_1.C" } */
 
 #include "pr66655.h"


[gcc r15-4825] testsuite: g++.dg: fix PR90313 filename

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6df5c49452a1fcf66cc1d15ab50d9de83d01cf1c

commit r15-4825-g6df5c49452a1fcf66cc1d15ab50d9de83d01cf1c
Author: Sam James 
Date:   Tue Oct 29 05:58:27 2024 +

testsuite: g++.dg: fix PR90313 filename

gcc/testsuite/ChangeLog:
PR c++/90313

* g++.dg/torture/pr90313.cc: Move to...
* g++.dg/torture/pr90313.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/torture/{pr90313.cc => pr90313.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/torture/pr90313.cc 
b/gcc/testsuite/g++.dg/torture/pr90313.C
similarity index 100%
rename from gcc/testsuite/g++.dg/torture/pr90313.cc
rename to gcc/testsuite/g++.dg/torture/pr90313.C


[gcc r15-4826] testsuite: g++.dg: torture: fix PR111520 filename

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:57d4ec18f577bad60e7f8bc9c0e4b14eb6d03fd0

commit r15-4826-g57d4ec18f577bad60e7f8bc9c0e4b14eb6d03fd0
Author: Sam James 
Date:   Tue Oct 29 05:58:49 2024 +

testsuite: g++.dg: torture: fix PR111520 filename

gcc/testsuite/ChangeLog:
PR tree-optimization/111520

* g++.dg/torture/harden-comp-pr111520.cc: Move to...
* g++.dg/torture/harden-comp-pr111520.C: ...here.

Diff:
---
 .../g++.dg/torture/{harden-comp-pr111520.cc => harden-comp-pr111520.C}| 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/torture/harden-comp-pr111520.cc 
b/gcc/testsuite/g++.dg/torture/harden-comp-pr111520.C
similarity index 100%
rename from gcc/testsuite/g++.dg/torture/harden-comp-pr111520.cc
rename to gcc/testsuite/g++.dg/torture/harden-comp-pr111520.C


[gcc r15-4827] testsuite: g++.dg: debug: fix test filenames

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:a287ff2697f0788856a21c99098611a5ae0a4749

commit r15-4827-ga287ff2697f0788856a21c99098611a5ae0a4749
Author: Sam James 
Date:   Tue Oct 29 06:00:08 2024 +

testsuite: g++.dg: debug: fix test filenames

gcc/testsuite/ChangeLog:
PR debug/15736
PR debug/46240

* g++.dg/debug/pr15736.cc: Move to...
* g++.dg/debug/pr15736.C: ...here.
* g++.dg/debug/pr46240.cc: Move to...
* g++.dg/debug/pr46240.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/debug/{pr15736.cc => pr15736.C} | 0
 gcc/testsuite/g++.dg/debug/{pr46240.cc => pr46240.C} | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/debug/pr15736.cc 
b/gcc/testsuite/g++.dg/debug/pr15736.C
similarity index 100%
rename from gcc/testsuite/g++.dg/debug/pr15736.cc
rename to gcc/testsuite/g++.dg/debug/pr15736.C
diff --git a/gcc/testsuite/g++.dg/debug/pr46240.cc 
b/gcc/testsuite/g++.dg/debug/pr46240.C
similarity index 100%
rename from gcc/testsuite/g++.dg/debug/pr46240.cc
rename to gcc/testsuite/g++.dg/debug/pr46240.C


[gcc r15-4819] testsuite: move single-file LTO pr95677 test to torture

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:778863eab72fdef226b8ac999b13a6ee71f397c0

commit r15-4819-g778863eab72fdef226b8ac999b13a6ee71f397c0
Author: Sam James 
Date:   Fri Oct 25 22:57:50 2024 +0100

testsuite: move single-file LTO pr95677 test to torture

This only started being used recently in r15-4681-g96110c14cf61a1 and
pinskia pointed out we may as well make it a proper torture test
instead as it's a single file LTO test.

gcc/testsuite/ChangeLog:
PR c++/95677

* g++.dg/lto/pr95677_0.C: Move to...
* g++.dg/torture/pr95677.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/{lto/pr95677_0.C => torture/pr95677.C} | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr95677_0.C 
b/gcc/testsuite/g++.dg/torture/pr95677.C
similarity index 71%
rename from gcc/testsuite/g++.dg/lto/pr95677_0.C
rename to gcc/testsuite/g++.dg/torture/pr95677.C
index d24279de0252..d33f5c8c33a2 100644
--- a/gcc/testsuite/g++.dg/lto/pr95677_0.C
+++ b/gcc/testsuite/g++.dg/torture/pr95677.C
@@ -1,9 +1,5 @@
 // PR c++/95677
-
-// { dg-lto-do link }
-// { dg-lto-options { -flto } }
-
-
+// { dg-do link }
 
 namespace {
   void foo() {


[gcc r15-4820] testsuite: move single-file LTO pr47333 test to torture

2024-10-31 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:bedd308c25ac00466bc4921a99279659cff8df51

commit r15-4820-gbedd308c25ac00466bc4921a99279659cff8df51
Author: Sam James 
Date:   Fri Oct 25 22:59:13 2024 +0100

testsuite: move single-file LTO pr47333 test to torture

This only started being used recently in r15-4683-g04e0fbbc34e101 and
pinskia pointed out we may as well make it a proper torture test
instead as it's a single file LTO test.

gcc/testsuite/ChangeLog:
PR target/47333

* g++.dg/lto/pr47333_0.C: Move to...
* g++.dg/torture/pr47333.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/{lto/pr47333_0.C => torture/pr47333.C} | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr47333_0.C 
b/gcc/testsuite/g++.dg/torture/pr47333.C
similarity index 99%
rename from gcc/testsuite/g++.dg/lto/pr47333_0.C
rename to gcc/testsuite/g++.dg/torture/pr47333.C
index 254a378f8dfd..06610425ebba 100644
--- a/gcc/testsuite/g++.dg/lto/pr47333_0.C
+++ b/gcc/testsuite/g++.dg/torture/pr47333.C
@@ -1,6 +1,5 @@
 /* { dg-require-effective-target sync_int_long } */
-/* "WARNING: lto.exp does not support dg-additional-options" */
-#pragma GCC diagnostic ignored "-Wtemplate-body"
+// { dg-additional-options "-Wno-template-body" }
 
 namespace std
 {


[gcc r15-3889] testsuite: fix comment-only directive typos

2024-09-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:98aac7c67f776601143f5d25353a304f72e87f54

commit r15-3889-g98aac7c67f776601143f5d25353a304f72e87f54
Author: Sam James 
Date:   Mon Aug 5 05:01:17 2024 +0100

testsuite: fix comment-only directive typos

Doing this to avoid FPs from grepping but also to avoid the potential
for people learning bad habits.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray/caf.exp: Fix 'dg-do-run' typo.
* lib/gfortran-dg.exp: Ditto.
* lib/gm2-dg.exp: Ditto.
* lib/go-dg.exp: Ditto.

Diff:
---
 gcc/testsuite/gfortran.dg/coarray/caf.exp | 2 +-
 gcc/testsuite/lib/gfortran-dg.exp | 2 +-
 gcc/testsuite/lib/gm2-dg.exp  | 2 +-
 gcc/testsuite/lib/go-dg.exp   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/coarray/caf.exp 
b/gcc/testsuite/gfortran.dg/coarray/caf.exp
index 31c13cd34e5e..9e608ecf83d0 100644
--- a/gcc/testsuite/gfortran.dg/coarray/caf.exp
+++ b/gcc/testsuite/gfortran.dg/coarray/caf.exp
@@ -78,7 +78,7 @@ foreach test [lsort [glob -nocomplain 
$srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]]
 }
 
 # Enable if you want to test several options:
-## look if this is dg-do-run test, in which case
+## look if this is dg-do run test, in which case
 ## we cycle through the option list, otherwise we don't
 #if [expr [search_for $test "dg-do run"]] {
 #  set option_list $torture_with_loops
diff --git a/gcc/testsuite/lib/gfortran-dg.exp 
b/gcc/testsuite/lib/gfortran-dg.exp
index 2edc09e5c995..726941c757f2 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -146,7 +146,7 @@ proc gfortran-dg-runtest { testcases flags 
default-extra-flags } {
continue
 }
 
-   # look if this is dg-do-run test, in which case
+   # look if this is dg-do run test, in which case
# we cycle through the option list, otherwise we don't
if [expr [search_for $test "dg-do run"]] {
set option_list $torture_with_loops
diff --git a/gcc/testsuite/lib/gm2-dg.exp b/gcc/testsuite/lib/gm2-dg.exp
index 7230143f80e8..0fa26846df84 100644
--- a/gcc/testsuite/lib/gm2-dg.exp
+++ b/gcc/testsuite/lib/gm2-dg.exp
@@ -59,7 +59,7 @@ proc gm2-dg-runtest { testcases flags default-extra-flags } {
continue
 }
 
-   # look if this is dg-do-run test, in which case
+   # look if this is dg-do run test, in which case
# we cycle through the option list, otherwise we don't
if [expr [search_for $test "dg-do run"]] {
set option_list $TORTURE_OPTIONS
diff --git a/gcc/testsuite/lib/go-dg.exp b/gcc/testsuite/lib/go-dg.exp
index d22835066252..bbc70a2301fd 100644
--- a/gcc/testsuite/lib/go-dg.exp
+++ b/gcc/testsuite/lib/go-dg.exp
@@ -47,7 +47,7 @@ proc go-dg-runtest { testcases flags default-extra-flags } {
continue
 }
 
-   # look if this is dg-do-run test, in which case
+   # look if this is dg-do run test, in which case
# we cycle through the option list, otherwise we don't
if [expr [search_for $test "dg-do run"]] {
set option_list $TORTURE_OPTIONS


[gcc r15-3890] testsuite: fix hyphen typos

2024-09-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:34bf6aa41ba5390ce26eb40208f10186d0ab17c4

commit r15-3890-g34bf6aa41ba5390ce26eb40208f10186d0ab17c4
Author: Sam James 
Date:   Fri Aug 2 06:38:34 2024 +0100

testsuite: fix hyphen typos

gcc/testsuite/ChangeLog:

* g++.dg/modules/reparent-1_c.C: Fix whitespace around '-' in dg 
directive.
* gfortran.dg/initialization_25.f90: Ditto.

Diff:
---
 gcc/testsuite/g++.dg/modules/reparent-1_c.C | 2 +-
 gcc/testsuite/gfortran.dg/initialization_25.f90 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/reparent-1_c.C 
b/gcc/testsuite/g++.dg/modules/reparent-1_c.C
index e4e984c87a9d..d3f7f51e335b 100644
--- a/gcc/testsuite/g++.dg/modules/reparent-1_c.C
+++ b/gcc/testsuite/g++.dg/modules/reparent-1_c.C
@@ -6,4 +6,4 @@ int main ()
   v (0); // { dg-error "too many arguments" }
 }
 
-// { dg -regexp {In module foo, imported at [^\n]*/reparent-1_b.C:14,\nof 
module bar, imported at [^\n]*/reparent-1_c.C:2:\n[^\n]*/reparent-1_a.C:6:13: 
note: declared here\n} }
+// { dg-regexp {In module foo, imported at [^\n]*/reparent-1_b.C:14,\nof 
module bar, imported at [^\n]*/reparent-1_c.C:2:\n[^\n]*/reparent-1_a.C:6:13: 
note: declared here\n} }
diff --git a/gcc/testsuite/gfortran.dg/initialization_25.f90 
b/gcc/testsuite/gfortran.dg/initialization_25.f90
index 66c447e2f1cb..c8edb163be04 100644
--- a/gcc/testsuite/gfortran.dg/initialization_25.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_25.f90
@@ -1,12 +1,12 @@
 ! { dg-do compile }
 !
 ! PR fortran/35779 - unrelated error message
-! Tescase contributed by
+! Testcase contributed by
 ! Dick Hendrickson 
 !
 ! Initial patch was reverted as it broke nested loops (see 
initialization_26.f90).
 !
 
 !   INTEGER :: J1
-!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg - error 
"does not reduce" }
+!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg-error "does 
not reduce" }
 END


[gcc r15-3878] testsuite: fix dejagnu typos with underscores

2024-09-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:d5864b95ce94d9d480a70ffd6e2e4a5f45dc75ed

commit r15-3878-gd5864b95ce94d9d480a70ffd6e2e4a5f45dc75ed
Author: Sam James 
Date:   Wed Jul 31 17:26:05 2024 +0100

testsuite: fix dejagnu typos with underscores

Fix typos in dejagnu 'dg-*' directives with erroneous underscores like
'dg_'.

gcc/testsuite/ChangeLog:
PR debug/30161
PR c++/91826
PR c++/116846

* g++.dg/debug/dwarf2/template-func-params-7.C: Fix errant 
underscore.
Cleanup whitespace in directives too.
* g++.dg/lookup/pr91826.C: Fix errant underscore.
* g++.dg/modules/indirect-1_b.C: Ditto.
* gcc.target/powerpc/vsx-builtin-msum.c: Ditto.

Diff:
---
 .../g++.dg/debug/dwarf2/template-func-params-7.C   | 18 +-
 gcc/testsuite/g++.dg/lookup/pr91826.C  |  2 +-
 gcc/testsuite/g++.dg/modules/indirect-1_b.C|  8 
 gcc/testsuite/gcc.target/powerpc/vsx-builtin-msum.c|  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C 
b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
index 9ce58a436af4..22b0e4f984da 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/template-func-params-7.C
@@ -6,23 +6,23 @@
 // There must be 5 subprograms generated:
 // printf(const char*), printf,
 // printf, printf and foo().
-// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_subprogram" 5 
} }
+// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_subprogram" 
5 } }
 
 // That makes 6 template type parameters.
-// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_template_type_param" 6 } }
-// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
-// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
-// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
-// { dg-final {scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
+// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_template_type_param" 6 } }
+// { dg-final { scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
+// { dg-final { scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
+// { dg-final { scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } 
}
+// { dg-final { scan-assembler-times "\"printf.0\"\[^\n\]*DW_AT_name" 1 } }
 
 // printf and printf have a pack expansion as
 // function parameters. There should then be 3
 // DW_TAG_GNU_template_parameter_pack and 3 DW_TAG_GNU_formal_parameter_pack 
DIEs
-// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_GNU_template_parameter_pack" 3 } }
-// { dg-final {scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_GNU_formal_parameter_pack" 3 } }
+// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_GNU_template_parameter_pack" 3 } }
+// { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) 
DW_TAG_GNU_formal_parameter_pack" 3 } }
 // These 3 function template instantiations has a total of 3 template
 // parameters named T.
-// { dg_final {scan-assembler-times "\.ascii \"T.0\"\[\t 
\]+\[^\n\]*DW_AT_name" 3 } }
+// { dg-final { scan-assembler-times "\.ascii \"T.0\"\[\t 
\]+\[^\n\]*DW_AT_name" 3 } }
 
 
 void
diff --git a/gcc/testsuite/g++.dg/lookup/pr91826.C 
b/gcc/testsuite/g++.dg/lookup/pr91826.C
index 2b313ece8a74..7954a0f68e1a 100644
--- a/gcc/testsuite/g++.dg/lookup/pr91826.C
+++ b/gcc/testsuite/g++.dg/lookup/pr91826.C
@@ -8,7 +8,7 @@ namespace N2
 {
   namespace N { class C2; }
   namespace A2 = N;
-  class A2::C2 {}; // { dg_bogus "does not enclose" }
+  class A2::C2 {}; // { dg-bogus "does not enclose" }
 }
 
 namespace N3 { namespace N { class C3; } }
diff --git a/gcc/testsuite/g++.dg/modules/indirect-1_b.C 
b/gcc/testsuite/g++.dg/modules/indirect-1_b.C
index 39e9d21ab76f..7621e05c86b9 100644
--- a/gcc/testsuite/g++.dg/modules/indirect-1_b.C
+++ b/gcc/testsuite/g++.dg/modules/indirect-1_b.C
@@ -48,7 +48,7 @@ namespace bar
 // { dg-final { scan-lang-dump {Lazily binding '::foo::Scoped'@'foo' section:} 
module } }
 // { dg-final { scan-lang-dump-not {Lazily binding 
'::foo::Scoped@foo:.::[ABCD]'@'foo' section:} module } }
 
-// { dg_final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::C'@foo} module } }
-// { dg_final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::B'@foo} module } }
-// { dg_final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::C'@foo} module } }
-// { dg_final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::B'@foo} module } }
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::C'@foo} module } }
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Pl

[gcc r15-3879] testsuite: XFAIL g++.dg/modules/indirect-1_b.C

2024-09-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6fee826bc1bbd4016d5b79e16e642d68c4007b09

commit r15-3879-g6fee826bc1bbd4016d5b79e16e642d68c4007b09
Author: Sam James 
Date:   Wed Sep 25 21:03:49 2024 +0100

testsuite: XFAIL g++.dg/modules/indirect-1_b.C

Mark the newly typo-fixed dg-final bits as XFAIL until investigated.

gcc/testsuite/ChangeLog:
PR c++/116846

* g++.dg/modules/indirect-1_b.C: Add XFAIL.

Diff:
---
 gcc/testsuite/g++.dg/modules/indirect-1_b.C | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/indirect-1_b.C 
b/gcc/testsuite/g++.dg/modules/indirect-1_b.C
index 7621e05c86b9..dee8a00ef15e 100644
--- a/gcc/testsuite/g++.dg/modules/indirect-1_b.C
+++ b/gcc/testsuite/g++.dg/modules/indirect-1_b.C
@@ -48,7 +48,8 @@ namespace bar
 // { dg-final { scan-lang-dump {Lazily binding '::foo::Scoped'@'foo' section:} 
module } }
 // { dg-final { scan-lang-dump-not {Lazily binding 
'::foo::Scoped@foo:.::[ABCD]'@'foo' section:} module } }
 
-// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::C'@foo} module } }
-// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::B'@foo} module } }
-// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::C'@foo} module } }
-// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::B'@foo} module } }
+// XFAIL is for PR116846
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::C'@foo} module { xfail *-*-* } } }
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Plain@\(foo\)::B'@foo} module { xfail *-*-* } } }
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::C'@foo} module { xfail *-*-* } } }
+// { dg-final { scan-lang-dump {Wrote named import:-[0-9]* 
const_decl:'::foo::Scoped@\(foo\)::B'@foo} module { xfail *-*-* } } }


[gcc r15-3899] testsuite: XFAIL gfortran.dg/initialization_25.f90 properly

2024-09-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:819098dc71f2079aedc15a904ab5f17f0788d991

commit r15-3899-g819098dc71f2079aedc15a904ab5f17f0788d991
Author: Sam James 
Date:   Thu Sep 26 15:43:33 2024 +0100

testsuite: XFAIL gfortran.dg/initialization_25.f90 properly

The test was disabled/XFAIL'd informally in r0-100012-gcdc6637d7c78ec,
but r15-3890-g34bf6aa41ba539 didn't realize this, causing a FAIL.

Fix that by marking it as XFAIL per the original intent.

gcc/testsuite/ChangeLog:
PR fortran/35779
PR fortran/116858

* gfortran.dg/initialization_25.f90: Mark as XFAIL.

Diff:
---
 gcc/testsuite/gfortran.dg/initialization_25.f90 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/initialization_25.f90 
b/gcc/testsuite/gfortran.dg/initialization_25.f90
index c8edb163be04..cae3bbd27d53 100644
--- a/gcc/testsuite/gfortran.dg/initialization_25.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_25.f90
@@ -5,8 +5,8 @@
 ! Dick Hendrickson 
 !
 ! Initial patch was reverted as it broke nested loops (see 
initialization_26.f90).
-!
+! XFAIL is for PR35779
 
 !   INTEGER :: J1
-!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg-error "does 
not reduce" }
+!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg-error "does 
not reduce" { xfail *-*-* } }
 END


[gcc r15-3949] testsuite: XFAIL gfortran.dg/initialization_25.f90 properly (again)

2024-09-29 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:f4d0c6acc0ef43d7971f2d53afaa64ca05fb4718

commit r15-3949-gf4d0c6acc0ef43d7971f2d53afaa64ca05fb4718
Author: Sam James 
Date:   Sun Sep 29 18:44:20 2024 +0100

testsuite: XFAIL gfortran.dg/initialization_25.f90 properly (again)

dg-error needs an argument for "why" / a comment.

gcc/testsuite/ChangeLog:
PR fortran/116858

* gfortran.dg/initialization_25.f90: Fix dg-error arguments.

Diff:
---
 gcc/testsuite/gfortran.dg/initialization_25.f90 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gfortran.dg/initialization_25.f90 
b/gcc/testsuite/gfortran.dg/initialization_25.f90
index cae3bbd27d53..805814a6 100644
--- a/gcc/testsuite/gfortran.dg/initialization_25.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_25.f90
@@ -8,5 +8,5 @@
 ! XFAIL is for PR35779
 
 !   INTEGER :: J1
-!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg-error "does 
not reduce" { xfail *-*-* } }
+!   INTEGER,PARAMETER :: I2(10) = (/(J1,J1=its_bad,1,-1)/) ! { dg-error "does 
not reduce" "PR35779" { xfail *-*-* } }
 END


[gcc r15-3725] testsuite: fix 'do-do' typos

2024-09-19 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:cfc95fafae19948c2281be09e9164cf57faaef49

commit r15-3725-gcfc95fafae19948c2281be09e9164cf57faaef49
Author: Sam James 
Date:   Thu Aug 15 00:38:36 2024 +0100

testsuite: fix 'do-do' typos

Fix 'do-do' typos (should be 'dg-do'). No change in logs.

gcc/testsuite/ChangeLog:

* g++.dg/other/operator2.C: Fix dg-do directive.
* gcc.dg/Warray-bounds-67.c: Ditto.
* gcc.dg/cpp/builtin-macro-1.c: Ditto.
* gcc.dg/tree-ssa/builtin-snprintf-3.c: Ditto.
* obj-c++.dg/empty-private-1.mm: Ditto.

Diff:
---
 gcc/testsuite/g++.dg/other/operator2.C | 2 +-
 gcc/testsuite/gcc.dg/Warray-bounds-67.c| 2 +-
 gcc/testsuite/gcc.dg/cpp/builtin-macro-1.c | 2 +-
 gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-3.c | 8 
 gcc/testsuite/obj-c++.dg/empty-private-1.mm| 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/g++.dg/other/operator2.C 
b/gcc/testsuite/g++.dg/other/operator2.C
index 358731127186..cd477a64c3f9 100644
--- a/gcc/testsuite/g++.dg/other/operator2.C
+++ b/gcc/testsuite/g++.dg/other/operator2.C
@@ -1,5 +1,5 @@
 // PR c++/28852
-// { do-do compile }
+// { dg-do compile }
 
 struct A
 {
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-67.c 
b/gcc/testsuite/gcc.dg/Warray-bounds-67.c
index a9b9ff7d2ab2..354fb89467e3 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-67.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-67.c
@@ -2,7 +2,7 @@
of a struct that's a member of either a struct or a union.  Both
are obviously undefined but GCC relies on these hacks so the test
verifies that -Warray-bounds doesn't trigger for it.
-   { do-do compile }
+   { dg-do compile }
{ dg-options "-O2 -Wall" } */
 
 
diff --git a/gcc/testsuite/gcc.dg/cpp/builtin-macro-1.c 
b/gcc/testsuite/gcc.dg/cpp/builtin-macro-1.c
index 0f950038d1bd..6fc3c2602785 100644
--- a/gcc/testsuite/gcc.dg/cpp/builtin-macro-1.c
+++ b/gcc/testsuite/gcc.dg/cpp/builtin-macro-1.c
@@ -5,7 +5,7 @@
the function-like macro expansion it's part of.
 
{ dg-do run }
-   { do-options -no-integrated-cpp }  */
+   { dg-options -no-integrated-cpp }  */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-3.c 
b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-3.c
index e481955ab732..00ea752c1974 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-3.c
@@ -1,6 +1,6 @@
 /* Verify the lower and upper bounds of floating directives with
precision whose range crosses zero.
-  { do-do compile }
+  { dg-do compile }
   { dg-options "-O2 -Wall -fdump-tree-optimized" } */
 
 static const double x = 1.23456789;
@@ -72,6 +72,6 @@ int test_g (int p)
   return n;
 }
 
-/* { dg-final { scan-tree-dump-times "snprintf" 4 "optimized"} }
-   { dg-final { scan-tree-dump-not "failure_range" "optimized"} }
-   { dg-final { scan-tree-dump-times "verify_" 8 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "snprintf" 4 "optimized" } }
+   { dg-final { scan-tree-dump-not "failure_range" "optimized" } }
+   { dg-final { scan-tree-dump-times "verify_" 8 "optimized" } } */
diff --git a/gcc/testsuite/obj-c++.dg/empty-private-1.mm 
b/gcc/testsuite/obj-c++.dg/empty-private-1.mm
index b8b90b07ecda..0bbec921b8ec 100644
--- a/gcc/testsuite/obj-c++.dg/empty-private-1.mm
+++ b/gcc/testsuite/obj-c++.dg/empty-private-1.mm
@@ -1,6 +1,6 @@
 /* Test for no entry after @private token.  */
 
-/* { do-do compile } */
+/* { dg-do compile } */
 
 @interface foo
 {


[gcc r15-3726] testsuite: debug: fix errant whitespace

2024-09-19 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:7203b6e0acfb458ed410af494f57253151a231ce

commit r15-3726-g7203b6e0acfb458ed410af494f57253151a231ce
Author: Sam James 
Date:   Fri Sep 20 05:37:24 2024 +0100

testsuite: debug: fix errant whitespace

I added some whitespace unintentionally in r15-3723-g284c03ec79ec20,
fix that.

gcc/testsuite/ChangeLog:

* gcc.dg/debug/btf/btf-datasec-1.c: Fix whitespace.

Diff:
---
 gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c 
b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
index 781f80774e2f..4a46479397a6 100644
--- a/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
+++ b/gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c
@@ -1,4 +1,3 @@
-
 /* BTF generation of BTF_KIND_DATASEC records.
 
We expect 3 DATASEC records: one for each of .data, .rodata and .bss.


[gcc r15-3723] testsuite: debug: fix dejagnu directive syntax

2024-09-19 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:284c03ec79ec206786673500b7813bd9f28b0075

commit r15-3723-g284c03ec79ec206786673500b7813bd9f28b0075
Author: Sam James 
Date:   Fri Sep 20 04:00:32 2024 +0100

testsuite: debug: fix dejagnu directive syntax

In this case, they were all harmless in reality (no diff in test logs).

gcc/testsuite/ChangeLog:

* gcc.dg/debug/btf/btf-array-1.c: Fix dg-do directive syntax.
* gcc.dg/debug/btf/btf-bitfields-1.c: Ditto.
* gcc.dg/debug/btf/btf-bitfields-2.c: Ditto.
* gcc.dg/debug/btf/btf-datasec-1.c: Ditto.
* gcc.dg/debug/btf/btf-union-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-anonymous-struct-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-anonymous-union-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-array-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-array-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-array-4.c: Ditto.
* gcc.dg/debug/ctf/ctf-array-5.c: Ditto.
* gcc.dg/debug/ctf/ctf-array-6.c: Ditto.
* gcc.dg/debug/ctf/ctf-attr-mode-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-attr-used-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-bitfields-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-bitfields-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-bitfields-3.c: Ditto.
* gcc.dg/debug/ctf/ctf-bitfields-4.c: Ditto.
* gcc.dg/debug/ctf/ctf-complex-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-cvr-quals-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-cvr-quals-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-cvr-quals-3.c: Ditto.
* gcc.dg/debug/ctf/ctf-cvr-quals-4.c: Ditto.
* gcc.dg/debug/ctf/ctf-enum-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-enum-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-file-scope-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-float-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-forward-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-forward-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-func-index-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-function-pointers-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-function-pointers-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-function-pointers-3.c: Ditto.
* gcc.dg/debug/ctf/ctf-function-pointers-4.c: Ditto.
* gcc.dg/debug/ctf/ctf-functions-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-int-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-objt-index-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-pointers-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-pointers-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-preamble-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-str-table-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-struct-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-struct-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-struct-array-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-struct-array-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-3.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-struct-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-struct-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-typedef-struct-3.c: Ditto.
* gcc.dg/debug/ctf/ctf-union-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-variables-1.c: Ditto.
* gcc.dg/debug/ctf/ctf-variables-2.c: Ditto.
* gcc.dg/debug/ctf/ctf-variables-3.c: Ditto.

Diff:
---
 gcc/testsuite/gcc.dg/debug/btf/btf-array-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/btf/btf-bitfields-2.c | 2 +-
 gcc/testsuite/gcc.dg/debug/btf/btf-datasec-1.c   | 3 ++-
 gcc/testsuite/gcc.dg/debug/btf/btf-union-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-anonymous-struct-1.c  | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-anonymous-union-1.c   | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-2.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-4.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-5.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-array-6.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-mode-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-attr-used-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-bitfields-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-bitfields-2.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-bitfields-3.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-bitfields-4.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-complex-1.c   | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-cvr-quals-1.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-cvr-quals-2.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-cvr-quals-3.c | 2 +-
 gcc/testsuite/gcc.dg/debug/ctf/ctf-cvr-quals-4.c  

[gcc r15-3729] testsuite: fix target-specific 'do-' typos

2024-09-20 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:0be3f4546f9b92eb149a12303bd1f13569da7f28

commit r15-3729-g0be3f4546f9b92eb149a12303bd1f13569da7f28
Author: Sam James 
Date:   Fri Aug 2 06:32:55 2024 +0100

testsuite: fix target-specific 'do-' typos

Fix some target-specific 'do-' (rather than 'dg-') typos.

gcc/testsuite/ChangeLog:

* gcc.target/m68k/pr108640.c: Fix dg directive typo.
* gcc.target/m68k/pr110934.c: Ditto.
* gcc.target/m68k/pr82420.c: Ditto.
* gcc.target/powerpc/pr99708.c: Ditto.

Diff:
---
 gcc/testsuite/gcc.target/m68k/pr108640.c   | 2 +-
 gcc/testsuite/gcc.target/m68k/pr110934.c   | 2 +-
 gcc/testsuite/gcc.target/m68k/pr82420.c| 2 +-
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/m68k/pr108640.c 
b/gcc/testsuite/gcc.target/m68k/pr108640.c
index 5f3e8b49d42e..80a32e751a39 100644
--- a/gcc/testsuite/gcc.target/m68k/pr108640.c
+++ b/gcc/testsuite/gcc.target/m68k/pr108640.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { do-options "-O1" } */
+/* { dg-options "-O1" } */
 
 int x;
 void andsi3(void) { x &= ~(1 << 16); }
diff --git a/gcc/testsuite/gcc.target/m68k/pr110934.c 
b/gcc/testsuite/gcc.target/m68k/pr110934.c
index 8c21d46f6600..3798cae18fb6 100644
--- a/gcc/testsuite/gcc.target/m68k/pr110934.c
+++ b/gcc/testsuite/gcc.target/m68k/pr110934.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { do-options "-fzero-call-used-regs=used -fpic -O2" } */
+/* { dg-options "-fzero-call-used-regs=used -fpic -O2" } */
 
 extern double clobber_fp0 (void);
 
diff --git a/gcc/testsuite/gcc.target/m68k/pr82420.c 
b/gcc/testsuite/gcc.target/m68k/pr82420.c
index 5c84f292103c..0261720f725f 100644
--- a/gcc/testsuite/gcc.target/m68k/pr82420.c
+++ b/gcc/testsuite/gcc.target/m68k/pr82420.c
@@ -1,4 +1,4 @@
-/* { do-do compile } */
+/* { dg-do compile } */
 /* { dg-options "-march=68000 -malign-int" } */
 
 int a;
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c 
b/gcc/testsuite/gcc.target/powerpc/pr99708.c
index c6aa0511b892..5d2f435a746b 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr99708.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-skip-if "" { powerpc*-*-darwin* powerpc-ibm-aix* } } */
-/* { require-effective-target ppc_float128_sw } */
+/* { dg-require-effective-target ppc_float128_sw } */
 /* { dg-options "-O2 -mvsx -mfloat128" } */
 
 /*


[gcc r15-3873] libstdc++: testsuite: fix dg-bogus directive syntax

2024-09-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:82d97278cc3adae40a13eef9ae6f339f87d1f8f6

commit r15-3873-g82d97278cc3adae40a13eef9ae6f339f87d1f8f6
Author: Sam James 
Date:   Fri Sep 20 08:31:45 2024 +0100

libstdc++: testsuite: fix dg-bogus directive syntax

These dg-bogus directives were bogus as they missed a closing brace.

```
+PASS: 23_containers/array/capacity/empty.cc  -std=gnu++17  (test for bogus 
messages, line 54)
 PASS: 23_containers/array/capacity/empty.cc  -std=gnu++17 (test for excess 
errors)
 PASS: 23_containers/array/capacity/empty.cc  -std=gnu++17 execution test
+PASS: 23_containers/array/capacity/max_size.cc  -std=gnu++17  (test for 
bogus messages, line 54)
 PASS: 23_containers/array/capacity/max_size.cc  -std=gnu++17 (test for 
excess errors)
 PASS: 23_containers/array/capacity/max_size.cc  -std=gnu++17 execution test
+PASS: 23_containers/array/capacity/size.cc  -std=gnu++17  (test for bogus 
messages, line 54)
```

libstdc++-v3/ChangeLog:
PR libstdc++/101831

* testsuite/23_containers/array/capacity/empty.cc: Add missing 
brace.
* testsuite/23_containers/array/capacity/max_size.cc: Ditto.
* testsuite/23_containers/array/capacity/size.cc: Ditto.

Diff:
---
 libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc| 2 +-
 libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc | 2 +-
 libstdc++-v3/testsuite/23_containers/array/capacity/size.cc | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc 
b/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
index 93342829b5c2..f1554ed6ed5d 100644
--- a/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
@@ -51,7 +51,7 @@ test02()
 typedef std::array array_type;
 array_type a;
 
-VERIFY( a.empty() == false );// { dg-bogus "-Wmaybe-uninitialized"
+VERIFY( a.empty() == false );// { dg-bogus "-Wmaybe-uninitialized" }
   }
 }
 
diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc 
b/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
index b6721ef1bb86..57d7895783c8 100644
--- a/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
@@ -51,7 +51,7 @@ test02()
 typedef std::array array_type;
 array_type a;
 
-VERIFY( a.max_size() == len );  // { dg-bogus "-Wmaybe-uninitialized"
+VERIFY( a.max_size() == len );  // { dg-bogus "-Wmaybe-uninitialized" }
   }
 }
 
diff --git a/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc 
b/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
index 524d1f9212ec..4769fd64b3c9 100644
--- a/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
@@ -51,7 +51,7 @@ test02()
 typedef std::array array_type;
 array_type a;
 
-VERIFY( a.size() == len );  // { dg-bogus "-Wmaybe-uninitialized"
+VERIFY( a.size() == len );  // { dg-bogus "-Wmaybe-uninitialized" }
   }
 }


[gcc r15-3874] ltmain.sh: allow more flags at link-time

2024-09-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ed6dccd00d8eedc8f671133f90e6a0cd12f1f05d

commit r15-3874-ged6dccd00d8eedc8f671133f90e6a0cd12f1f05d
Author: Sam James 
Date:   Wed Aug 14 04:09:39 2024 +0100

ltmain.sh: allow more flags at link-time

libtool defaults to filtering flags passed at link-time.

This brings the filtering in GCC's 'fork' of libtool into sync with
upstream libtool commit 22a7e547e9857fc94fe5bc7c921d9a4b49c09f8e.

In particular, this now allows some harmless diagnostic flags (especially
useful for things like -Werror=odr), more optimization flags, and some
Clang-specific options.

GCC's -flto documentation mentions:
> To use the link-time optimizer, -flto and optimization options should be
> specified at compile time and during the final link. It is recommended
> that you compile all the files participating in the same link with the
> same options and also specify those options at link time.

This allows compliance with that.

* ltmain.sh (func_mode_link): Allow various flags through filter.

Diff:
---
 ltmain.sh | 46 ++
 1 file changed, 34 insertions(+), 12 deletions(-)

diff --git a/ltmain.sh b/ltmain.sh
index 70990740b6c4..1a710177fb26 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -4968,19 +4968,41 @@ func_mode_link ()
arg="$func_quote_for_eval_result"
;;
 
-  # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-  # -r[0-9][0-9]* specifies the processor on the SGI compiler
-  # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-  # +DA*, +DD* enable 64-bit mode on the HP compiler
-  # -q* pass through compiler args for the IBM compiler
-  # -m*, -t[45]*, -txscale* pass through architecture-specific
-  # compiler args for GCC
-  # -F/path gives path to uninstalled frameworks, gcc on darwin
-  # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-  # @file GCC response files
-  # -tp=* Portland pgcc target processor selection
+  # Flags to be passed through unchanged, with rationale:
+  # -64, -mips[0-9]  enable 64-bit mode for the SGI compiler
+  # -r[0-9][0-9]*specify processor for the SGI compiler
+  # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+  # +DA*, +DD*   enable 64-bit mode for the HP compiler
+  # -q*  compiler args for the IBM compiler
+  # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+  # -F/path  path to uninstalled frameworks, gcc on darwin
+  # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+  # -fstack-protector*   stack protector flags for GCC
+  # @fileGCC response files
+  # -tp=*Portland pgcc target processor selection
+  # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time 
optimization
+  # -specs=* GCC specs files
+  # -stdlib=*select c++ std lib with clang
+  # -fdiagnostics-color* simply affects output
+  # -frecord-gcc-switches used to verify flags were respected
+  # -fsanitize=* Clang/GCC memory and address sanitizer
+  # -fno-sanitize*   Clang/GCC memory and address sanitizer
+  # -shared-libsan   Link with shared sanitizer runtimes (Clang)
+  # -static-libsan   Link with static sanitizer runtimes (Clang)
+  # -fuse-ld=*   Linker select flags for GCC
+  # -rtlib=* select c runtime lib with clang
+  # --unwindlib=*select unwinder library with clang
+  # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking
+  # -Wa,*Pass flags directly to the assembler
+  # -Werror, -Werror=*   Report (specified) warnings as errors
   -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-  -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
+  -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*| \
+  -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*| \
+  -stdlib=*|-rtlib=*|--unwindlib=*| \
+  -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+  
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*|
 \
+  -fdiagnostics-color*|-frecord-gcc-switches| \
+  -fuse-ld=*|-Wa,*|-Werror|-Werror=*)
 func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
 func_append compile_command " $arg"


[gcc r15-4685] testsuite: lto: fix tbaa_0 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:091e45b4e97d1ecf765bf3afb58cecda23fee23c

commit r15-4685-g091e45b4e97d1ecf765bf3afb58cecda23fee23c
Author: Sam James 
Date:   Fri Oct 25 17:59:31 2024 +0100

testsuite: lto: fix tbaa_0 test

These failures were hidden until we started to run the test by fixing
the filename earlier: use dg-lto directives, pass -std=gnu89 for
implicit-int, and use -flto-partition=none like 
c-c++-common/hwasan/builtin-special-handling.c.

gcc/testsuite/ChangeLog:

* gcc.dg/lto/tbaa_0.c: Use dg-lto directives, pass -std=gnu89, and
use -flto-partition=none.

Diff:
---
 gcc/testsuite/gcc.dg/lto/tbaa_0.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/lto/tbaa_0.c 
b/gcc/testsuite/gcc.dg/lto/tbaa_0.c
index 74c049671133..eb14ea62b896 100644
--- a/gcc/testsuite/gcc.dg/lto/tbaa_0.c
+++ b/gcc/testsuite/gcc.dg/lto/tbaa_0.c
@@ -1,5 +1,7 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -flto -fdump-tree-evrp" } */
+/* { dg-lto-do link } */
+/* We need -flto=partition=none to get the dump file for scan-tree-dump-times. 
*/
+/* { dg-lto-options {{ -O2 -flto -flto-partition=none -fdump-tree-evrp 
-std=gnu89 }} } */
+
 typedef struct rtx_def *rtx;
 typedef struct cselib_val_struct
 {
@@ -38,4 +40,4 @@ discard_useless_locs (x, info)
   n_useless_values++;
 }
 }
-/* { dg-final { scan-tree-dump-times "n_useless_values" 2 "evrp" } } */
 
+/* { dg-final { scan-tree-dump-times "n_useless_values" 2 "evrp" } } */


[gcc r15-4687] testsuite: lto: fix pr62026 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:908b306909f10d7592a0ef611cc77b5720f07fa7

commit r15-4687-g908b306909f10d7592a0ef611cc77b5720f07fa7
Author: Sam James 
Date:   Fri Oct 25 20:55:39 2024 +0100

testsuite: lto: fix pr62026 test

This failure was hidden until we started to run the test by fixing
the filename earlier: pass -Wno-return-type.

gcc/testsuite/ChangeLog:
PR lto/62026

* g++.dg/lto/pr62026_0.C: Pass -Wno-return-type.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr62026_0.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr62026_0.C 
b/gcc/testsuite/g++.dg/lto/pr62026_0.C
index 0432e907f56f..d6445ee9b4d8 100644
--- a/gcc/testsuite/g++.dg/lto/pr62026_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr62026_0.C
@@ -1,5 +1,5 @@
 // { dg-lto-do link }
-// { dg-lto-options {{-flto -O3 -r}} }
+// { dg-lto-options {{-flto -O3 -r -Wno-return-type}} }
 class C;
 class F {
   virtual C m_fn1();


[gcc r15-4688] testsuite: lto: fix pr47333 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2266e38cfd8071262004f164ebe37f60e2d4615d

commit r15-4688-g2266e38cfd8071262004f164ebe37f60e2d4615d
Author: Sam James 
Date:   Fri Oct 25 21:12:21 2024 +0100

testsuite: lto: fix pr47333 test

This failure was hidden until we started to run the test by fixing
the filename earlier: ignore -Wtemplate-body using a pragma like
e.g. g++.dg/lto/20101010-1_0.C does because lto.exp doesn't support
dg-additional-options.

gcc/testsuite/ChangeLog:
PR lto/47333

* g++.dg/lto/pr47333_0.C: Ignore -Wtemplate-body.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr47333_0.C | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/testsuite/g++.dg/lto/pr47333_0.C 
b/gcc/testsuite/g++.dg/lto/pr47333_0.C
index 60873ca07c7a..b171c8cb9604 100644
--- a/gcc/testsuite/g++.dg/lto/pr47333_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr47333_0.C
@@ -1,3 +1,6 @@
+/* "WARNING: lto.exp does not support dg-additional-options" */
+#pragma GCC diagnostic ignored "-Wtemplate-body"
+
 namespace std
 {
   typedef unsigned int size_t;


[gcc r15-4684] testsuite: lto: rename tbaa-1 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2d1d6be00257c5ad9031986ac2f6f3d0a96d935a

commit r15-4684-g2d1d6be00257c5ad9031986ac2f6f3d0a96d935a
Author: Sam James 
Date:   Fri Oct 25 16:31:32 2024 +0100

testsuite: lto: rename tbaa-1 test

This was being ignored previously. Rename it per README.

gcc/testsuite/ChangeLog:

* gcc.dg/lto/tbaa-1.c: Move to...
* gcc.dg/lto/tbaa_0.c: ...here.

Diff:
---
 gcc/testsuite/gcc.dg/lto/{tbaa-1.c => tbaa_0.c} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/lto/tbaa-1.c 
b/gcc/testsuite/gcc.dg/lto/tbaa_0.c
similarity index 100%
rename from gcc/testsuite/gcc.dg/lto/tbaa-1.c
rename to gcc/testsuite/gcc.dg/lto/tbaa_0.c


[gcc r15-4682] testsuite: lto: rename pr62026 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:03ff420aa0a916ab835129d9575c7029116ec4f9

commit r15-4682-g03ff420aa0a916ab835129d9575c7029116ec4f9
Author: Sam James 
Date:   Fri Oct 25 16:30:49 2024 +0100

testsuite: lto: rename pr62026 test

This was being ignored previously. Rename it per README.

gcc/testsuite/ChangeLog:
PR lto/62026

* g++.dg/lto/pr62026.C: Move to...
* g++.dg/lto/pr62026_0.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/lto/{pr62026.C => pr62026_0.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr62026.C 
b/gcc/testsuite/g++.dg/lto/pr62026_0.C
similarity index 100%
rename from gcc/testsuite/g++.dg/lto/pr62026.C
rename to gcc/testsuite/g++.dg/lto/pr62026_0.C


[gcc r15-4686] testsuite: lto: fix pr95677 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:e87c1af38d551cb7f81e10f57bf245a2b8f039be

commit r15-4686-ge87c1af38d551cb7f81e10f57bf245a2b8f039be
Author: Sam James 
Date:   Fri Oct 25 18:02:06 2024 +0100

testsuite: lto: fix pr95677 test

These failures were hidden until we started to run the test by fixing
the filename earlier: use dg-lto directives.

gcc/testsuite/ChangeLog:
PR c++/95677

* g++.dg/lto/pr95677_0.C: Use dg-lto-*.

Diff:
---
 gcc/testsuite/g++.dg/lto/pr95677_0.C | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr95677_0.C 
b/gcc/testsuite/g++.dg/lto/pr95677_0.C
index 520ef04e61c8..d24279de0252 100644
--- a/gcc/testsuite/g++.dg/lto/pr95677_0.C
+++ b/gcc/testsuite/g++.dg/lto/pr95677_0.C
@@ -1,8 +1,7 @@
 // PR c++/95677
 
-// { dg-do link }
-// { dg-require-effective-target lto }
-// { dg-options "-flto" }
+// { dg-lto-do link }
+// { dg-lto-options { -flto } }


[gcc r15-4681] testsuite: lto: rename pr95677 test

2024-10-25 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:96110c14cf61a1f8ecae04b8d947a60758363701

commit r15-4681-g96110c14cf61a1f8ecae04b8d947a60758363701
Author: Sam James 
Date:   Mon Oct 21 12:13:34 2024 +0100

testsuite: lto: rename pr95677 test

This was being ignored previously. Rename it per README.

gcc/testsuite/ChangeLog:
PR c++/95677

* g++.dg/lto/pr95677.C: Move to...
* g++.dg/lto/pr95677_0.C: ...here.

Diff:
---
 gcc/testsuite/g++.dg/lto/{pr95677.C => pr95677_0.C} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/gcc/testsuite/g++.dg/lto/pr95677.C 
b/gcc/testsuite/g++.dg/lto/pr95677_0.C
similarity index 100%
rename from gcc/testsuite/g++.dg/lto/pr95677.C
rename to gcc/testsuite/g++.dg/lto/pr95677_0.C


[gcc r15-5294] gcc: regenerate configure

2024-11-14 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:7744da67e95824e15de5773e608aeb3d2bbd8653

commit r15-5294-g7744da67e95824e15de5773e608aeb3d2bbd8653
Author: Sam James 
Date:   Thu Nov 14 20:52:43 2024 +

gcc: regenerate configure

r15-5257-g56ded80b96b0f6 didn't regenerate configure correctly.

See 
https://inbox.sourceware.org/gcc-patches/zzzf69gorvpro...@zen.kayari.org/.

gcc/ChangeLog:

* configure: Regenerate.

Diff:
---
 gcc/configure | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index df64af3af57e..19cb5d069590 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1780,11 +1780,13 @@ Optional Features:
   Use nano version formatted IO
 
   --enable-standard-branch-protection
-  enable Branch Target Identification Mechanism and
-  Return Address Signing by default for AArch64
+  enable Branch Target Identification Mechanism,
+  Return Address Signing, and Guarded Control Stack by
+  default for AArch64
   --disable-standard-branch-protection
-  disable Branch Target Identification Mechanism and
-  Return Address Signing by default for AArch64
+  disable Branch Target Identification Mechanism,
+  Return Address Signing, and Guarded Control Stack by
+  default for AArch64
 
 
   --enable-fix-cortex-a53-835769
@@ -21454,7 +21456,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 21457 "configure"
+#line 21459 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -21560,7 +21562,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 21563 "configure"
+#line 21565 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H


[gcc r15-5332] testsuite: graphite: adapt to -std=gnu23 default change

2024-11-15 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:714f7d8e3ace3f3f42ff80e25d48780310089653

commit r15-5332-g714f7d8e3ace3f3f42ff80e25d48780310089653
Author: Sam James 
Date:   Sat Nov 16 03:12:33 2024 +

testsuite: graphite: adapt to -std=gnu23 default change

r15-5327-g55e3bd376b2214 changes the default to -std=gnu23 but these
tests now trigger -Wold-style-definition. Follow Joseph's advice
in that commit and tweak the tests accordingly.

gcc/testsuite/ChangeLog:

* gcc.dg/graphite/id-15.c: Pass -Wno-old-style-definition.
* gcc.dg/graphite/pr38413.c: Ditto.
* gcc.dg/graphite/pr38510.c: Ditto.

Diff:
---
 gcc/testsuite/gcc.dg/graphite/id-15.c   | 1 +
 gcc/testsuite/gcc.dg/graphite/pr38413.c | 2 +-
 gcc/testsuite/gcc.dg/graphite/pr38510.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/graphite/id-15.c 
b/gcc/testsuite/gcc.dg/graphite/id-15.c
index d1cb2a2519bf..d0a804c876bf 100644
--- a/gcc/testsuite/gcc.dg/graphite/id-15.c
+++ b/gcc/testsuite/gcc.dg/graphite/id-15.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-Wno-old-style-definition" } */
 /* { dg-require-effective-target int32plus } */
 
 typedef long unsigned int size_t;
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38413.c 
b/gcc/testsuite/gcc.dg/graphite/pr38413.c
index 0e7df604..877511c6ab2d 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr38413.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr38413.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fgraphite-identity" } */
+/* { dg-options "-O2 -fgraphite-identity -Wno-old-style-definition" } */
 
 static int qsz;
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr38510.c 
b/gcc/testsuite/gcc.dg/graphite/pr38510.c
index 8c7fcae39a98..f05c03df0f72 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr38510.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr38510.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fgraphite-identity" } */
+/* { dg-options "-O2 -fgraphite-identity -Wno-old-style-definition" } */
 typedef long int integer;
 typedef double doublereal;


[gcc r15-5333] testsuite: i386: adapt to -std=gnu23 default change

2024-11-15 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:6aabe3adef1d951293d78115c9e3e129096b6abe

commit r15-5333-g6aabe3adef1d951293d78115c9e3e129096b6abe
Author: Sam James 
Date:   Sat Nov 16 03:14:19 2024 +

testsuite: i386: adapt to -std=gnu23 default change

r15-5327-g55e3bd376b2214 changes the default to -std=gnu23 but this
test relies on unprototyped functions. Follow Joseph's advice
in that commit and tweak the test accordingly.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr66891.c: Pass -std=gnu17.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr66891.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr66891.c 
b/gcc/testsuite/gcc.target/i386/pr66891.c
index 61a45703196d..cd79fb5fdd61 100644
--- a/gcc/testsuite/gcc.target/i386/pr66891.c
+++ b/gcc/testsuite/gcc.target/i386/pr66891.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target ia32 } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -std=gnu17" } */
 
 __attribute__((__stdcall__)) void fn1();


[gcc r13-9217] gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

2024-11-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:e236e9edbe78f2be5224a0f188ae3bb74d6b3c1b

commit r13-9217-ge236e9edbe78f2be5224a0f188ae3bb74d6b3c1b
Author: Arsen Arsenović 
Date:   Thu Aug 15 19:17:41 2024 +0200

gnat: fix lto-type-mismatch between C_Version_String and 
gnat_version_string [PR115917]

gcc/ada/ChangeLog:

PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.

(cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302)

Diff:
---
 gcc/ada/gnatvsn.ads | 3 ++-
 gcc/ada/version.c   | 5 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index b6edc9dabed9..308986afc182 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -83,7 +83,8 @@ package Gnatvsn is
--  space to store any possible version string value for checks. This
--  value should never be decreased in the future, but it would be
--  OK to increase it if absolutely necessary. If it is increased,
-   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well.
+   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max, and to update
+   --  the VER_LEN_MAX define in version.c as well.
 
Ver_Prefix : constant String := "GNAT Version: ";
--  Prefix generated by binder. If it is changed, be sure to change
diff --git a/gcc/ada/version.c b/gcc/ada/version.c
index 5e64edd0b17d..2fa9b8c2c859 100644
--- a/gcc/ada/version.c
+++ b/gcc/ada/version.c
@@ -31,4 +31,7 @@
 
 #include "version.h"
 
-char gnat_version_string[] = version_string;
+/* Logically a reference to Gnatvsn.Ver_Len_Max.  Please keep in sync.  */
+#define VER_LEN_MAX 256
+
+char gnat_version_string[VER_LEN_MAX] = version_string;


[gcc r14-10991] gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

2024-11-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:29c9213c3759f7ba24cdd498a5bc379cb9d16e5e

commit r14-10991-g29c9213c3759f7ba24cdd498a5bc379cb9d16e5e
Author: Arsen Arsenović 
Date:   Thu Aug 15 19:17:41 2024 +0200

gnat: fix lto-type-mismatch between C_Version_String and 
gnat_version_string [PR115917]

gcc/ada/ChangeLog:

PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.

(cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302)

Diff:
---
 gcc/ada/gnatvsn.ads | 3 ++-
 gcc/ada/version.c   | 5 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index 29238362cc04..f2082ece0965 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -83,7 +83,8 @@ package Gnatvsn is
--  space to store any possible version string value for checks. This
--  value should never be decreased in the future, but it would be
--  OK to increase it if absolutely necessary. If it is increased,
-   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well.
+   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max, and to update
+   --  the VER_LEN_MAX define in version.c as well.
 
Ver_Prefix : constant String := "GNAT Version: ";
--  Prefix generated by binder. If it is changed, be sure to change
diff --git a/gcc/ada/version.c b/gcc/ada/version.c
index 5e64edd0b17d..2fa9b8c2c859 100644
--- a/gcc/ada/version.c
+++ b/gcc/ada/version.c
@@ -31,4 +31,7 @@
 
 #include "version.h"
 
-char gnat_version_string[] = version_string;
+/* Logically a reference to Gnatvsn.Ver_Len_Max.  Please keep in sync.  */
+#define VER_LEN_MAX 256
+
+char gnat_version_string[VER_LEN_MAX] = version_string;


[gcc r12-10833] gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]

2024-11-26 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:2897bfe8f9efdf58a61e955b51821cc49d2a9cfc

commit r12-10833-g2897bfe8f9efdf58a61e955b51821cc49d2a9cfc
Author: Arsen Arsenović 
Date:   Thu Aug 15 19:17:41 2024 +0200

gnat: fix lto-type-mismatch between C_Version_String and 
gnat_version_string [PR115917]

gcc/ada/ChangeLog:

PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.

(cherry picked from commit 9cbcf8d1de159e6113fafb5dc2feb4a7e467a302)

Diff:
---
 gcc/ada/gnatvsn.ads | 3 ++-
 gcc/ada/version.c   | 5 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index 47a06b96c3cf..99d06c7e5aa4 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -83,7 +83,8 @@ package Gnatvsn is
--  space to store any possible version string value for checks. This
--  value should never be decreased in the future, but it would be
--  OK to increase it if absolutely necessary. If it is increased,
-   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well.
+   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max, and to update
+   --  the VER_LEN_MAX define in version.c as well.
 
Ver_Prefix : constant String := "GNAT Version: ";
--  Prefix generated by binder. If it is changed, be sure to change
diff --git a/gcc/ada/version.c b/gcc/ada/version.c
index 5e64edd0b17d..2fa9b8c2c859 100644
--- a/gcc/ada/version.c
+++ b/gcc/ada/version.c
@@ -31,4 +31,7 @@
 
 #include "version.h"
 
-char gnat_version_string[] = version_string;
+/* Logically a reference to Gnatvsn.Ver_Len_Max.  Please keep in sync.  */
+#define VER_LEN_MAX 256
+
+char gnat_version_string[VER_LEN_MAX] = version_string;


[gcc r15-6612] testsuite: add testcase for fixed PR117546

2025-01-06 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:f9ff478446a2cac8f73c906fb3dbeade5aa46909

commit r15-6612-gf9ff478446a2cac8f73c906fb3dbeade5aa46909
Author: Sam James 
Date:   Fri Jan 3 16:56:01 2025 +

testsuite: add testcase for fixed PR117546

PR117546 was fixed by Eric's r14-10693-gadab597af288d6 change, but
the testcase here is sufficiently different to be worth including
in torture/.

gcc/testsuite/ChangeLog:
PR ipa/117546
* gcc.dg/torture/pr117546.c: New test.

Diff:
---
 gcc/testsuite/gcc.dg/torture/pr117546.c | 84 +
 1 file changed, 84 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/torture/pr117546.c 
b/gcc/testsuite/gcc.dg/torture/pr117546.c
new file mode 100644
index ..21e2aef18b9a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr117546.c
@@ -0,0 +1,84 @@
+/* { dg-do run } */
+
+typedef struct {
+  int a;
+  int b;
+} c;
+
+typedef struct {
+  int a;
+  int b;
+  int d;
+} e;
+
+typedef struct {
+  int f;
+  int g;
+} h;
+
+typedef struct {
+  h i[1];
+  e coords[100];
+} j;
+
+struct k {
+  j glyf;
+} l;
+
+int m, n;
+double o;
+e *q;
+e r;
+
+int s(c *v) {
+  if (v[0].a == m)
+__builtin_abort();
+  int t = v[0].a + v[2].b * (v[2].b - v[0].b),
+  u = (2. + v[4].b - v[2].b) * (v[4].b - v[2].b);
+  if (t <= 3 * u) {
+v[0] = v[4];
+return 1;
+  }
+  return 0;
+}
+
+void w(struct k *v) {
+  c p[5];
+  e *a = &v->glyf.coords[0];
+  if (a->d)
+p[0].a = p[0].b = a->b;
+  q = &r;
+  o = p[0].b;
+  while (v->glyf.i[0].g--) {
+q = q == &r ? a : q + 1;
+if (q->d)
+  switch (n) {
+  case 2:
+p[4].a = q->a;
+p[4].b = q->b;
+n = s(p);
+  }
+else
+  switch (n) {
+  case 0:
+n = 1;
+break;
+  case 1:
+p[2].b = q->b;
+n = 2;
+break;
+  case 2:
+if (s(p))
+  n = 1;
+  }
+  }
+}
+
+int main() {
+  l.glyf.i[0] = (h){0, 26};
+  l.glyf.coords[0] = (e){4, 2, 3};
+  l.glyf.coords[3] = (e){2, 126, 3};
+  l.glyf.coords[4] = (e){2, 206};
+  l.glyf.coords[6] = (e){0, 308, 5};
+  w(&l);
+}


[gcc r15-6613] testsuite: add testcase for fixed PR98000

2025-01-06 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:e53277d849a13a8a36f488f6725700311c74080e

commit r15-6613-ge53277d849a13a8a36f488f6725700311c74080e
Author: Sam James 
Date:   Fri Jan 3 16:59:37 2025 +

testsuite: add testcase for fixed PR98000

gcc/testsuite/ChangeLog:
PR ipa/98000
* g++.dg/ipa/pr98000.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/ipa/pr98000.C | 68 ++
 1 file changed, 68 insertions(+)

diff --git a/gcc/testsuite/g++.dg/ipa/pr98000.C 
b/gcc/testsuite/g++.dg/ipa/pr98000.C
new file mode 100644
index ..893812fd0cfd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr98000.C
@@ -0,0 +1,68 @@
+/* { dg-do compile { target c++17 } } */
+/* { dg-options "-Og -w" } */
+
+struct {
+  template  T *operator()(T);
+} hb_addressof;
+template  static int _hb_cmp_method(Ts...) 
{
+  return 0;
+}
+template 
+inline bool hb_bsearch_impl(K key, V, int compar(void *, void *)) {
+  V p;
+  int __trans_tmp_2 = *hb_addressof(key) = compar(&__trans_tmp_2, p);
+  return false;
+}
+struct hb_array_t {
+  int arrayZ;
+};
+struct hb_sorted_array_t : hb_array_t {
+  void bsearch() {
+hb_bsearch_impl(bsearch_impl_x, &arrayZ, _hb_cmp_method);
+  }
+  int bsearch_impl_x;
+};
+template  struct hb_lazy_loader_t {
+  Returned *operator->();
+};
+namespace OT {
+struct COLR;
+}
+struct hb_ot_face_t {
+  hb_lazy_loader_t COLR;
+};
+struct {
+  hb_ot_face_t table;
+} hb_ot_color_glyph_get_layers_face;
+namespace OT {
+struct IntType {
+  typedef int wide_type;
+  operator wide_type();
+};
+struct UnsizedArrayOf;
+struct OffsetTo {
+  template  friend UnsizedArrayOf operator+(Base, OffsetTo);
+};
+template  using LOffsetTo = OffsetTo;
+template  using LNNOffsetTo = LOffsetTo;
+struct UnsizedArrayOf {
+  void as_array(int);
+};
+struct SortedUnsizedArrayOf {
+  hb_sorted_array_t __trans_tmp_4;
+  void bsearch() { __trans_tmp_4.bsearch(); }
+};
+struct COLR {
+  SortedUnsizedArrayOf __trans_tmp_3;
+  int get_glyph_layers() {
+__trans_tmp_3.bsearch();
+int __trans_tmp_3 = numLayers;
+(this + layersZ).as_array(__trans_tmp_3);
+  }
+  LNNOffsetTo layersZ;
+  IntType numLayers;
+};
+} // namespace OT
+void hb_ot_color_glyph_get_layers() {
+  hb_ot_color_glyph_get_layers_face.table.COLR->get_glyph_layers();
+}


[gcc r15-6546] testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init=

2025-01-03 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:26ca00eeedb01f9d5102586b76ae2a6e787111af

commit r15-6546-g26ca00eeedb01f9d5102586b76ae2a6e787111af
Author: Sam James 
Date:   Fri Dec 13 04:42:29 2024 +

testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init=

This testcase came up in a recent LLVM bug report [0] for DSE vs
-ftrivial-auto-var-init=. Add it to our testsuite given that area
could do with better coverage.

[0] https://github.com/llvm/llvm-project/issues/119646

gcc/testsuite/ChangeLog:

* gcc.dg/torture/dse-trivial-auto-var-init.c: New test.

Co-authored-by: Andrew Pinski 

Diff:
---
 .../gcc.dg/torture/dse-trivial-auto-var-init.c  | 17 +
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/torture/dse-trivial-auto-var-init.c 
b/gcc/testsuite/gcc.dg/torture/dse-trivial-auto-var-init.c
new file mode 100644
index ..5a3d4c4e3ecb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/dse-trivial-auto-var-init.c
@@ -0,0 +1,17 @@
+/* Testcase for LLVM bug: https://github.com/llvm/llvm-project/issues/119646 */
+/* { dg-do run } */
+/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
+
+int b = 208;
+[[gnu::noinline]]
+void f(int *e, int a) {
+  *e = !!b;
+  if (a)
+__builtin_trap();
+}
+int main(void) {
+  b = 0;
+  f(&b, 0);
+  if (b != 0)
+__builtin_trap();
+}


[gcc r15-6485] doc: cpp: fix version test example syntax

2025-01-01 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:ea25066d8a9106bb015720328d4645cd1ddd2bab

commit r15-6485-gea25066d8a9106bb015720328d4645cd1ddd2bab
Author: Sam James 
Date:   Wed Jan 1 17:16:17 2025 +

doc: cpp: fix version test example syntax

gcc/ChangeLog:

* doc/cpp.texi (Common Predefined Macros): Fix syntax.

Diff:
---
 gcc/doc/cpp.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 970c0a393971..4b0f2d9bb857 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -1974,7 +1974,7 @@ like this:
 #if __GNUC__ > 3 || \
 (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
(__GNUC_MINOR__ == 2 && \
-__GNUC_PATCHLEVEL__ > 0))
+__GNUC_PATCHLEVEL__ > 0)))
 @end smallexample
 
 @noindent


[gcc r15-6160] i386: regenerate i386.opt.urls

2024-12-12 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:63317bf991ff336bbbfae5a5744a0220693e42f3

commit r15-6160-g63317bf991ff336bbbfae5a5744a0220693e42f3
Author: Sam James 
Date:   Thu Dec 12 10:52:00 2024 +

i386: regenerate i386.opt.urls

r15-6128-gfa878dc8c45fa3 missed the regeneration of the URL doc map, so
regenerate it here to make the buildbots happy.

gcc/ChangeLog:

* config/i386/i386.opt.urls: Regenerate.

Diff:
---
 gcc/config/i386/i386.opt.urls | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.opt.urls b/gcc/config/i386/i386.opt.urls
index 1ff0c9c2256e..2f8ae60b1d06 100644
--- a/gcc/config/i386/i386.opt.urls
+++ b/gcc/config/i386/i386.opt.urls
@@ -446,7 +446,8 @@ 
UrlSuffix(gcc/x86-Options.html#index-mstack-protector-guard-reg-3)
 mstack-protector-guard-offset=
 UrlSuffix(gcc/x86-Options.html#index-mstack-protector-guard-offset-4)
 
-; skipping UrlSuffix for 'mstack-protector-guard-symbol=' due to finding no 
URLs
+mstack-protector-guard-symbol=
+UrlSuffix(gcc/x86-Options.html#index-mstack-protector-guard-symbol)
 
 mgeneral-regs-only
 UrlSuffix(gcc/x86-Options.html#index-mgeneral-regs-only-2)


[gcc r15-5604] Sync top-level configure with binutils

2024-11-22 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:7ff5900399c889ce1984092552040dfb7e73a4b2

commit r15-5604-g7ff5900399c889ce1984092552040dfb7e73a4b2
Author: Sam James 
Date:   Fri Nov 22 19:09:36 2024 +

Sync top-level configure with binutils

This syncs us with binutils/gdb's toplevel configure as of
987db70acefd0b223a8df2240d4e5ca544cc0a91.

There's not much notable here, just gprofng (which is in binutils) being
disabled for musl and a new target which got added on that side too.

The only part which may look interesting is the baseargs->bbaseargs
change which goes back to Arsen's gettext work and a fixup which
landed for that on the binutils side in
9c0aa4c53104b1c4333d55aeaf11b41053307929.

* configure: Regenerate.
* configure.ac: Sync with Binutils.

Diff:
---
 configure| 21 ++---
 configure.ac | 22 ++
 2 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index 10c1589d473c..c6796040fd8a 100755
--- a/configure
+++ b/configure
@@ -1551,7 +1551,7 @@ Optional Features:
 
   --enable-gold[=ARG] build gold [ARG={default,yes,no}]
   --enable-ld[=ARG]   build ld [ARG={default,yes,no}]
-  --enable-gprofng[=ARG]  build gprofng [ARG={yes,no}]
+  --disable-gprofng   do not build gprofng
   --enable-compressed-debug-sections={all,gas,gold,ld,none}
   Enable compressed debug sections for gas, gold or ld
   by default
@@ -3151,7 +3151,9 @@ fi
 
 if test "$enable_gprofng" = "yes"; then
   case "${target}" in
-x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
+*-musl*)
+  ;;
+x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux* | riscv64-*-linux*)
 configdirs="$configdirs gprofng"
 ;;
   esac
@@ -3670,6 +3672,15 @@ case "${target}" in
   cris-*-* | crisv32-*-*)
 libgloss_dir=cris
 ;;
+  kvx-*-elf)
+libgloss_dir=kvx-elf
+;;
+  kvx-*-mbr)
+libgloss_dir=kvx-mbr
+;;
+  kvx-*-cos)
+libgloss_dir=kvx-cos
+;;
   hppa*-*-*)
 libgloss_dir=pa
 ;;
@@ -3971,6 +3982,9 @@ case "${target}" in
   i[3456789]86-*-rdos*)
 noconfigdirs="$noconfigdirs gdb"
 ;;
+  kvx-*-*)
+noconfigdirs="$noconfigdirs gdb gdbserver sim"
+;;
   mmix-*-*)
 noconfigdirs="$noconfigdirs gdb"
 ;;
@@ -11314,7 +11328,8 @@ hbaseargs="$hbaseargs --disable-option-checking"
 tbaseargs="$tbaseargs --disable-option-checking"
 
 if test "$enable_year2038" = no; then
-  baseargs="$baseargs --disable-year2038"
+  bbaseargs="$bbaseargs --disable-year2038"
+  hbaseargs="$hbaseargs --disable-year2038"
   tbaseargs="$tbaseargs --disable-year2038"
 fi
 
diff --git a/configure.ac b/configure.ac
index fb61550dba7b..a8d13b31ee2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -407,13 +407,14 @@ case "${ENABLE_LD}" in
 esac
 
 AC_ARG_ENABLE(gprofng,
-[AS_HELP_STRING([[--enable-gprofng[=ARG]]],
-   [build gprofng @<:@ARG={yes,no}@:>@])],
+[AS_HELP_STRING([[--disable-gprofng]], [do not build gprofng])],
 enable_gprofng=$enableval,
 enable_gprofng=yes)
 if test "$enable_gprofng" = "yes"; then
   case "${target}" in
-x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux*)
+*-musl*)
+  ;;
+x86_64-*-linux* | i?86-*-linux* | aarch64-*-linux* | riscv64-*-linux*)
 configdirs="$configdirs gprofng"
 ;;
   esac
@@ -892,6 +893,15 @@ case "${target}" in
   cris-*-* | crisv32-*-*)
 libgloss_dir=cris
 ;;
+  kvx-*-elf)
+libgloss_dir=kvx-elf
+;;
+  kvx-*-mbr)
+libgloss_dir=kvx-mbr
+;;
+  kvx-*-cos)
+libgloss_dir=kvx-cos
+;;
   hppa*-*-*)
 libgloss_dir=pa
 ;;
@@ -1193,6 +1203,9 @@ case "${target}" in
   i[[3456789]]86-*-rdos*)
 noconfigdirs="$noconfigdirs gdb"
 ;;
+  kvx-*-*)
+noconfigdirs="$noconfigdirs gdb gdbserver sim"
+;;
   mmix-*-*)
 noconfigdirs="$noconfigdirs gdb"
 ;;
@@ -3543,7 +3556,8 @@ hbaseargs="$hbaseargs --disable-option-checking"
 tbaseargs="$tbaseargs --disable-option-checking"
 
 if test "$enable_year2038" = no; then
-  baseargs="$baseargs --disable-year2038"
+  bbaseargs="$bbaseargs --disable-year2038"
+  hbaseargs="$hbaseargs --disable-year2038"
   tbaseargs="$tbaseargs --disable-year2038"
 fi


[gcc r12-10892] doc: cpp: fix version test example syntax

2025-01-09 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:36db43d30282521732736ba5da23c397fb51f1e0

commit r12-10892-g36db43d30282521732736ba5da23c397fb51f1e0
Author: Sam James 
Date:   Wed Jan 1 17:16:17 2025 +

doc: cpp: fix version test example syntax

gcc/ChangeLog:

* doc/cpp.texi (Common Predefined Macros): Fix syntax.

Diff:
---
 gcc/doc/cpp.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 90b2767e39a0..fe92522a7b7f 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -1970,7 +1970,7 @@ like this:
 #if __GNUC__ > 3 || \
 (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
(__GNUC_MINOR__ == 2 && \
-__GNUC_PATCHLEVEL__ > 0))
+__GNUC_PATCHLEVEL__ > 0)))
 @end smallexample
 
 @noindent


[gcc r14-11195] doc: cpp: fix version test example syntax

2025-01-09 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:91b524aa80e2ce22c4613f6bea625a72d1f5f4ed

commit r14-11195-g91b524aa80e2ce22c4613f6bea625a72d1f5f4ed
Author: Sam James 
Date:   Wed Jan 1 17:16:17 2025 +

doc: cpp: fix version test example syntax

gcc/ChangeLog:

* doc/cpp.texi (Common Predefined Macros): Fix syntax.

Diff:
---
 gcc/doc/cpp.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 3de6e7aa7378..a2f982c510af 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -1971,7 +1971,7 @@ like this:
 #if __GNUC__ > 3 || \
 (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
(__GNUC_MINOR__ == 2 && \
-__GNUC_PATCHLEVEL__ > 0))
+__GNUC_PATCHLEVEL__ > 0)))
 @end smallexample
 
 @noindent


[gcc r13-9290] doc: cpp: fix version test example syntax

2025-01-09 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:5ff315e398b6a790471029950dd7eef4e168c312

commit r13-9290-g5ff315e398b6a790471029950dd7eef4e168c312
Author: Sam James 
Date:   Wed Jan 1 17:16:17 2025 +

doc: cpp: fix version test example syntax

gcc/ChangeLog:

* doc/cpp.texi (Common Predefined Macros): Fix syntax.

Diff:
---
 gcc/doc/cpp.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index b0a2ce3ac6b6..48a877e6fd38 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -1970,7 +1970,7 @@ like this:
 #if __GNUC__ > 3 || \
 (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
(__GNUC_MINOR__ == 2 && \
-__GNUC_PATCHLEVEL__ > 0))
+__GNUC_PATCHLEVEL__ > 0)))
 @end smallexample
 
 @noindent


[gcc r15-6928] doc: cleanup trailing whitespace

2025-01-15 Thread Sam James via Gcc-cvs
https://gcc.gnu.org/g:c340ff207f0fd297231e9d5c093c06c11b84bede

commit r15-6928-gc340ff207f0fd297231e9d5c093c06c11b84bede
Author: Sam James 
Date:   Wed Jan 15 22:51:31 2025 +

doc: cleanup trailing whitespace

gcc/ChangeLog:

* doc/extend.texi: Cleanup trailing whitespace.

Diff:
---
 gcc/doc/extend.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 84894efc2ea4..52ba78b80361 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -15355,7 +15355,7 @@ a function if it does not.  For example:
 
 You may use this built-in function in either a macro or an inline
 function.  However, if you use it in an inlined function and pass an
-argument of the function as the argument to the built-in, GCC 
+argument of the function as the argument to the built-in, GCC
 never returns 1 when you call the inline function with a string constant
 or compound literal (@pxref{Compound Literals}) and does not return 1
 when you pass a constant numeric value to the inline function unless you
@@ -15520,9 +15520,9 @@ when testing pointer or floating-point values.
 
 For the purposes of branch prediction optimizations, the probability that
 a @code{__builtin_expect} expression is @code{true} is controlled by GCC's
-@code{builtin-expect-probability} parameter, which defaults to 90%.  
+@code{builtin-expect-probability} parameter, which defaults to 90%.
 
-You can also use @code{__builtin_expect_with_probability} to explicitly 
+You can also use @code{__builtin_expect_with_probability} to explicitly
 assign a probability value to individual expressions.  If the built-in
 is used in a loop construct, the provided probability will influence
 the expected number of iterations made by loop optimizations.


  1   2   >