Re: [PATCH] fixincludes: bypass the math_exception fix on __cplusplus

2024-06-10 Thread Rainer Orth
Hi FX,

>> However, please note that the comment states
>> * This should be bypassed on __cplusplus, but some supposedly C++
>> * aware headers, such as Solaris 8 and 9, don't wrap their struct
>> It's "such as Solaris 8 and 9", so there may well be others.
>
> I know, but that was 24 years ago, and I could find zero documentation
> anywhere (mailing-list or bugzilla) of what those other targets could be. I
> don’t think it’s unreasonable, for the benefit of all the other working
> targets, to reverse now. It is early in stage 1, and the fix be restored if
> needed on specific targets.

I know, and I certainly won't oppose removing such cruft, just stating
that you won't find out what breaks until something breaks ;-)  The
problem is: if those fixes are only needed on lesser-used (and -tested)
targets, it may take quite some time until one does find out...

I'd have loved to remove fixes that mention obsolete Solaris versions,
but refrained from doing so when there was no way of knowing that no
innocent would be harmed.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] libstdc++: Introduce scale factor in 30_threads/future/members/poll.cc [PR98678]

2024-06-10 Thread Rainer Orth
30_threads/future/members/poll.cc consistently FAILs on Solaris/x86
(both 32 and 64-bit):

FAIL: 30_threads/future/members/poll.cc  -std=gnu++17 execution test

/vol/gcc/src/hg/master/local/libstdc++-v3/testsuite/30_threads/future/members/poll.cc:95:
 int main(): Assertion 'wait_until_sys_min < (ready * 100)' failed.
wait_for(0s): 11892ns for 200 calls, avg 59.46ns per call
wait_until(system_clock minimum): 1304458ns for 200 calls, avg 6522.29ns per 
call
wait_until(steady_clock minimum): 1403221ns for 200 calls, avg 7016.1ns per call
wait_until(system_clock epoch): 3343806ns for 200 calls, avg 16719ns per call
wait_until(steady_clock epoch: 2959581ns for 200 calls, avg 14797.9ns per call
wait_for when ready: 10969ns for 200 calls, avg 54.845ns per call

As reported in the PR, across a considerable range of CPUs the test
doesn't complete in the expected time.  Therefore, this patch introduces
a Solaris/x86 specific scale factor to allow for that.

There's no such issue on Solaris/SPARC, though.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-04  Rainer Orth  

libstdc++-v3:
PR libstdc++/98678
* testsuite/30_threads/future/members/poll.cc (main): Introduce
scale factor.

# HG changeset patch
# Parent  8f086e53ab093c8919708b1689a86f2bc407
libstdc++: Introduce scale factor in 30_threads/future/members/poll.cc [PR98678]

diff --git a/libstdc++-v3/testsuite/30_threads/future/members/poll.cc b/libstdc++-v3/testsuite/30_threads/future/members/poll.cc
--- a/libstdc++-v3/testsuite/30_threads/future/members/poll.cc
+++ b/libstdc++-v3/testsuite/30_threads/future/members/poll.cc
@@ -129,14 +129,21 @@ int main()
   VERIFY( wait_for_0 < (ready * 30) );
 
   // Polling before ready using wait_until(min) should not be terribly slow.
-  VERIFY( wait_until_sys_min < (ready * 100) );
-  VERIFY( wait_until_steady_min < (ready * 100) );
+  // These tests consistently time out on a couple of targets, so provide
+  // scale factor.
+#if defined(__sun) && defined(__svr4__) && (defined(__i386__) || defined(__x86_64__))
+  double scale = 2.5;
+#else
+  double scale = 1.0;
+#endif
+  VERIFY( wait_until_sys_min < (ready * 100 * scale) );
+  VERIFY( wait_until_steady_min < (ready * 100 * scale) );
 
   // The following two tests fail with GCC 11, see
   // https://gcc.gnu.org/pipermail/libstdc++/2020-November/051422.html
 #if 0
   // Polling before ready using wait_until(epoch) should not be terribly slow.
-  VERIFY( wait_until_sys_epoch < (ready * 100) );
-  VERIFY( wait_until_steady_epoch < (ready * 100) );
+  VERIFY( wait_until_sys_epoch < (ready * 100 * scale) );
+  VERIFY( wait_until_steady_epoch < (ready * 100 * scale) );
 #endif
 }


Re: [PATCH] fixincludes: bypass the math_exception fix on __cplusplus

2024-06-10 Thread Rainer Orth
Hi FX,

> The fixincludes fix “math_exception” is being applied overly broadly,
> including many targets which don’t need it, like darwin (and probably all
> non-glibc targets). I’m not sure if it is still needed on any target, but
> because I can’t be absolutely positive about that, I don’t want to remove
> it. But it dates from before 1998.

right: that's the ugly thing about those fixes that aren't restricted to
particular targets.  Even if they were introduced for a specific set of
targets initially, there's no way of knowing if they are aren't needed
elsewere, too.  In fact, they *may* be needed and nobody nobody noticed
because the fix was already in place.  This makes them almost impossible
to get rid of.

> In subsequent times (2000) it was bypassed on glibc headers, as well as
> Solaris 10. It was still needed on Solaris 8 and 9, which are (AFAICT)
> unsupported nowadays. The fix was originally bypassed on __cplusplus, which
> is the correct thing to do, but that bypass was neutralized to cater to a
> bug on Solaris 8 and 9 headers. Now that those are gone… let’s revert to

Solaris 8 and 9 support is long gone from trunk.  In fact, the only
Solaris version supported there is 11.4.

However, please note that the comment states

 * This should be bypassed on __cplusplus, but some supposedly C++
 * aware headers, such as Solaris 8 and 9, don't wrap their struct

It's "such as Solaris 8 and 9", so there may well be others.  Commercial
OSes in particular can retain their headers (bugs and all) for very long
times ;-(  It make take quite some insistence from customers or
developes to have them changed (I know all too well from the Solaris
side of things, and you probably have similar experiences for Darwin).

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] go: Fix gccgo -v on Solaris with ld

2024-06-06 Thread Rainer Orth
The Go testsuite's go.sum file ends in

Couldn't determine version of 
/var/gcc/regression/master/11.4-gcc-64/build/gcc/gccgo

on Solaris.  It turns out this happens because gccgo -v is confused:

[...]
gcc version 15.0.0 20240531 (experimental) [master 
a0d60660f2aae2d79685f73d568facb2397582d8] (GCC) 
COMPILER_PATH=./:/usr/ccs/bin/
LIBRARY_PATH=./:/lib/amd64/:/usr/lib/amd64/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-g1' '-B' './' '-v' '-shared-libgcc' '-mtune=generic' 
'-march=x86-64' '-dumpdir' 'a.'
 ./collect2 -V -M ./libgcc-unwind.map -Qy /usr/lib/amd64/crt1.o ./crtp.o 
/usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o /usr/lib/amd64/values-xpg6.o 
./crtbegin.o -L. -L/lib/amd64 -L/usr/lib/amd64 -t -lgcc_s -lgcc -lc -lgcc_s 
-lgcc ./crtend.o /usr/lib/amd64/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.3297
Undefined   first referenced
 symbol in file
main/usr/lib/amd64/crt1.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status

trying to invoke the linker without adding any object file.  This only
happens when Solaris ld is in use.  gccgo passes -t to the linker in
that case, but does it unconditionally, even with -v.

When configured to use GNU ld, gccgo -v is fine instead.

This patch avoids this by restricting the -t to actually linking.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (ld and gld).

Ok for trunk?

I believe this has to go via gofrontend, though.

Raine

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-05  Rainer Orth  

gcc/go:
* gospec.cc (lang_specific_driver) [TARGET_SOLARIS !USE_GLD]: Only
add -t if linking.

# HG changeset patch
# Parent  361d219108e4be29bd4c59bb6cb74e460a0e9126
go: Fix gccgo -v on Solaris with ld

diff --git a/gcc/go/gospec.cc b/gcc/go/gospec.cc
--- a/gcc/go/gospec.cc
+++ b/gcc/go/gospec.cc
@@ -443,8 +443,11 @@ lang_specific_driver (struct cl_decoded_
  using the GNU linker, the Solaris linker needs an option to not
  warn about this.  Everything works without this option, but you
  get unsightly warnings at link time.  */
-  generate_option (OPT_Wl_, "-t", 1, CL_DRIVER, _decoded_options[j]);
-  j++;
+  if (library > 0)
+{
+  generate_option (OPT_Wl_, "-t", 1, CL_DRIVER, _decoded_options[j]);
+  j++;
+}
 #endif
 
   *in_decoded_options_count = j;


[PATCH] testsuite: go: Require split-stack support for go.test/test/index0.go [PR87589]

2024-06-06 Thread Rainer Orth
The index0-out.go test FAILs on Solaris (SPARC and x86, 32 and 64-bit),
as well as several others:

FAIL: ./index0-out.go execution,  -O0 -g -fno-var-tracking-assignments 

The test SEGVs because it tries a stack acess way beyond the stack
area.  As Ian analyzed in the PR, the testcase currently requires
split-stack support, so this patch requires just that.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-05  Rainer Orth  

gcc/testsuite:
PR go/87589
* go.test/go-test.exp (go-gc-tests): Require split-stack support
for index0.go.

# HG changeset patch
# Parent  f29c8ac19b89d7ed6c5d957b99e03c8a387f6c31
testsuite: go: Require split-stack support for go.test/test/index0.go [PR87589]

diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp
--- a/gcc/testsuite/go.test/go-test.exp
+++ b/gcc/testsuite/go.test/go-test.exp
@@ -477,7 +477,8 @@ proc go-gc-tests { } {
 	if { ( [file tail $test] == "select2.go" \
 		   || [file tail $test] == "stack.go" \
 		   || [file tail $test] == "peano.go" \
-		   || [file tail $test] == "nilptr2.go" ) \
+		   || [file tail $test] == "nilptr2.go" \
+		   || [file tail $test] == "index0.go" ) \
 		 && ! [check_effective_target_split_stack] } {
 	# These tests fails on targets without split stack.
 	untested $name


[COMMITTED] testsuite: i386: Require ifunc support in gcc.target/i386/avx10_1-25.c etc.

2024-06-04 Thread Rainer Orth
Two new AVX10.1 tests FAIL on Solaris/x86:

FAIL: gcc.target/i386/avx10_1-25.c (test for excess errors)
FAIL: gcc.target/i386/avx10_1-26.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/i386/avx10_1-25.c:6:9: 
error: the call requires 'ifunc', which is not supported by this target

Fixed by requiring ifunc support.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-04  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/avx10_1-25.c: Require ifunc support.
* gcc.target/i386/avx10_1-26.c: Likewise.

# HG changeset patch
# Parent  7cb61d7bce1654ccbf8fb8ae6d61041b77df4fdd
testsuite: i386: Require ifunc support in gcc.target/i386/avx10_1-25.c etc.

diff --git a/gcc/testsuite/gcc.target/i386/avx10_1-25.c b/gcc/testsuite/gcc.target/i386/avx10_1-25.c
--- a/gcc/testsuite/gcc.target/i386/avx10_1-25.c
+++ b/gcc/testsuite/gcc.target/i386/avx10_1-25.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mavx" } */
+/* { dg-require-ifunc "" } */
 
 #include 
 __attribute__((target_clones ("default","avx10.1-256")))
diff --git a/gcc/testsuite/gcc.target/i386/avx10_1-26.c b/gcc/testsuite/gcc.target/i386/avx10_1-26.c
--- a/gcc/testsuite/gcc.target/i386/avx10_1-26.c
+++ b/gcc/testsuite/gcc.target/i386/avx10_1-26.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mavx512f" } */
+/* { dg-require-ifunc "" } */
 
 #include 
 __attribute__((target_clones ("default","avx10.1-512")))


[PATCH] testsuite: analyzer: Skip tests with non-numeric macros on Solaris [PR107750]

2024-06-03 Thread Rainer Orth
A couple of gcc.dg/analyzer/fd-*.c tests still FAIL on Solaris.  The
reason is always the same: they use macros that don't expand to simple
numbers, something which c/c-parser.cc
(ana::c_translation_unit::consider_macro) cannot handle:

* :

#define SOCK_STREAM NC_TPI_COTS /* stream socket */
#define SOCK_DGRAM  NC_TPI_CLTS /* datagram socket */

* :

#define O_ACCMODE   (O_SEARCH | O_EXEC | 0x3)

To avoid the resulting noise, this patch skips the affected tests.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-03  Rainer Orth  

gcc/testsuite:
PR analyzer/107750
* gcc.dg/analyzer/fd-accept.c: Skip on *-*-solaris2*.
* gcc.dg/analyzer/fd-access-mode-target-headers.c: Likewise.
* gcc.dg/analyzer/fd-connect.c: Likewise.
* gcc.dg/analyzer/fd-datagram-socket.c: Likewise.
* gcc.dg/analyzer/fd-listen.c: Likewise.
* gcc.dg/analyzer/fd-socket-misuse.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket-active-open.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket-passive-open.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket.c: Likewise.

# HG changeset patch
# Parent  dcf4ce6a5230564d3513bebe58ddb2863a7cf90e
testsuite: analyzer: Skip tests with non-numeric macros on Solaris [PR107750]

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-accept.c b/gcc/testsuite/gcc.dg/analyzer/fd-accept.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-accept.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-accept.c
@@ -1,5 +1,6 @@
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c b/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-access-mode-target-headers.c
@@ -1,4 +1,5 @@
 /* { dg-skip-if "" { { powerpc*-*-aix* avr-*-* *-*-vxworks* } || newlib } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-connect.c b/gcc/testsuite/gcc.dg/analyzer/fd-connect.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-connect.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-connect.c
@@ -1,5 +1,6 @@
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-datagram-socket.c
@@ -1,5 +1,6 @@
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-listen.c b/gcc/testsuite/gcc.dg/analyzer/fd-listen.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-listen.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-listen.c
@@ -1,5 +1,6 @@
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-socket-misuse.c b/gcc/testsuite/gcc.dg/analyzer/fd-socket-misuse.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-socket-misuse.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-socket-misuse.c
@@ -2,6 +2,7 @@
 
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-active-open.c b/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-active-open.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-active-open.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-active-open.c
@@ -1,5 +1,6 @@
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if "PR analyzer/107750" { *-*-solaris2* } } */
 
 #include 
 #include 
diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-passive-open.c b/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-passive-open.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-passive-open.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-stream-socket-passive-open.c
@@ -4,6 +4,7 @@
 
 /* { dg-require-effective-target sockets } */
 /* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-skip-if &q

[COMMITTED] testsuite: Require vect_shift in gcc.dg/vect/pr112325.c [PR115303]

2024-06-03 Thread Rainer Orth
The new gcc.dg/vect/pr112325.c test FAILs on Solaris/SPARC:

FAIL: gcc.dg/vect/pr112325.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorized 1 loops" 1
FAIL: gcc.dg/vect/pr112325.c scan-tree-dump-times vect "vectorized 1 loops" 1

As analyzed in the PR, the test requires vect_shift, so this patch adds
that requirement.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Pre-approved by Richard in the PR, committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-06-03  Rainer Orth  

gcc/testsuite:
PR tree-optimization/115303
* gcc.dg/vect/pr112325.c: Require vect_shift.

diff --git a/gcc/testsuite/gcc.dg/vect/pr112325.c b/gcc/testsuite/gcc.dg/vect/pr112325.c
--- a/gcc/testsuite/gcc.dg/vect/pr112325.c
+++ b/gcc/testsuite/gcc.dg/vect/pr112325.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -funroll-loops -fdump-tree-vect-details" } */
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
 /* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */
 
 typedef unsigned short ggml_fp16_t;


[COMMITTED] build: Include minor version in config.gcc unsupported message

2024-05-31 Thread Rainer Orth
It has been pointed out to me that when moving Solaris 11.3 from
config.gcc's obsolete to unsupported list, I'd forgotten to also move
the minor version info, leading to confusing

*** Configuration i386-pc-solaris2.11 not supported

instead of the correct

*** Configuration i386-pc-solaris2.11.3 not supported

This patch fixes this oversight.

Tested on i386-pc-solaris2.11 (11.3 and 11.4).  Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-30  Rainer Orth  

gcc:
* config.gcc: Move ${target_min} from obsolete to unsupported
message.

# HG changeset patch
# Parent  a457e38f3743f8fe1336d94b6d1a5f336057b128
build: Include minor version in config.gcc unsupported message

diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -276,7 +276,7 @@ case ${target} in
| nios2*-*-*\
  )
 if test "x$enable_obsolete" != xyes; then
-  echo "*** Configuration ${target}${target_min} is obsolete." >&2
+  echo "*** Configuration ${target} is obsolete." >&2
   echo "*** Specify --enable-obsolete to build it anyway." >&2
   echo "*** Support will be REMOVED in the next major release of GCC," >&2
   echo "*** unless a maintainer comes forward." >&2
@@ -328,7 +328,7 @@ case ${target}${target_min} in
  | *-*-sysv*\
  | vax-*-vms*\
  )
-	echo "*** Configuration ${target} not supported" 1>&2
+	echo "*** Configuration ${target}${target_min} not supported" 1>&2
 	exit 1
 	;;
 esac


Re: [COMMITTED] ggc: Reduce GGC_QUIRE_SIZE on Solaris/SPARC [PR115031]

2024-05-31 Thread Rainer Orth
Hi Eric,

>> It turns out that this exhaustion of the 32-bit address space happens
>> due to a combination of three issues:
>> 
>> * the SPARC pagesize of 8 kB,
>> 
>> * ggc-page.cc's chunk size of 512 * pagesize, i.e. 4 MB, and
>> 
>> * mmap adding two 8 kB unmapped red-zone pages to each mapping
>> 
>> which result in the 4 MB mappings to actually consume 4.5 MB of address
>> space.
>> 
>> To avoid this, this patch reduces the chunk size so it remains at 4 MB
>> even when combined with the red-zone pages, as recommended by mmap(2).
>
> Nice investigation!  This size is a host parameter rather than a target one 
> though, so config/sparc/sol2.h is probably not the most appropriate place to 
> override it, but I personally do not mind.

ah, I tend to forget, not having built a cross compiler in ages.  I'll
leave it as is for the moment, though, since there's no Solaris host
header ATM.

Thanks for the hint.

    Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] testsuite: Adjust several dg-additional-files-options calls [PR115294]

2024-05-31 Thread Rainer Orth
A recent patch

commit bdc264a16e327c63d133131a695a202fbbc0a6a0
Author: Alexandre Oliva 
Date:   Thu May 30 02:06:48 2024 -0300

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

added two additional args to dg-additional-files-options.
Unfortunately, this completely broke several testsuites like

ERROR: tcl error sourcing 
/vol/gcc/src/hg/master/local/libatomic/testsuite/../../gcc/testsuite/lib/gcc-dg.exp.
wrong # args: should be "dg-additional-files-options options source dest type"

since the patch forgot to adjust some of the callers.

This patch fixes that.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-31  Rainer Orth  

libatomic:
PR testsuite/115294
* testsuite/lib/libatomic.exp (libatomic_target_compile): Pass new
dg-additional-files-options args.

libgomp:
PR testsuite/115294
* testsuite/lib/libgomp.exp (libgomp_target_compile): Pass new
dg-additional-files-options args.

libitm:
PR testsuite/115294
* testsuite/lib/libitm.exp (libitm_target_compile): Pass new
dg-additional-files-options args.

libphobos:
PR testsuite/115294
* testsuite/lib/libphobos.exp (libphobos_target_compile): Pass new
dg-additional-files-options args.

libvtv:
PR testsuite/115294
* testsuite/lib/libvtv.exp (libvtv_target_compile): Pass new
dg-additional-files-options args.

# HG changeset patch
# Parent  83e1dad81f5eb46a0216b67de025afa9396cbbe3
testsuite: Adjust several dg-additional-files-options calls [PR115294]

diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -214,7 +214,7 @@ proc libatomic_target_compile { source d
 	set options [concat "$ALWAYS_CFLAGS" $options]
 }
 
-set options [dg-additional-files-options $options $source]
+set options [dg-additional-files-options $options $source $dest $type]
 
 set result [target_compile $source $dest $type $options]
 
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -296,7 +296,7 @@ proc libgomp_target_compile { source des
 	set options [concat "$ALWAYS_CFLAGS" $options]
 }
 
-set options [dg-additional-files-options $options $source]
+set options [dg-additional-files-options $options $source $dest $type]
 
 set result [target_compile $source $dest $type $options]
 
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
--- a/libitm/testsuite/lib/libitm.exp
+++ b/libitm/testsuite/lib/libitm.exp
@@ -217,7 +217,7 @@ proc libitm_target_compile { source dest
 	set options [concat "$ALWAYS_CFLAGS" $options]
 }
 
-set options [dg-additional-files-options $options $source]
+set options [dg-additional-files-options $options $source $dest $type]
 
 set result [target_compile $source $dest $type $options]
 
diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp
--- a/libphobos/testsuite/lib/libphobos.exp
+++ b/libphobos/testsuite/lib/libphobos.exp
@@ -281,7 +281,7 @@ proc libphobos_target_compile { source d
 lappend options "compiler=$gdc_final"
 lappend options "timeout=[timeout_value]"
 
-set options [dg-additional-files-options $options $source]
+set options [dg-additional-files-options $options $source $dest $type]
 set comp_output [target_compile $source $dest $type $options]
 
 return $comp_output
diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp
--- a/libvtv/testsuite/lib/libvtv.exp
+++ b/libvtv/testsuite/lib/libvtv.exp
@@ -212,7 +212,7 @@ proc libvtv_target_compile { source dest
 	set options [concat "$ALWAYS_CFLAGS" $options]
 }
 
-set options [dg-additional-files-options $options $source]
+set options [dg-additional-files-options $options $source $dest $type]
 
 set result [target_compile $source $dest $type $options]
 


[COMMITTED] ggc: Reduce GGC_QUIRE_SIZE on Solaris/SPARC [PR115031]

2024-05-30 Thread Rainer Orth
g++.dg/modules/pr99023_b.X currently FAILs on 32-bit Solaris/SPARC:

FAIL: g++.dg/modules/pr99023_b.X -std=c++2a  1 blank line(s) in output
FAIL: g++.dg/modules/pr99023_b.X -std=c++2a (test for excess errors)

Excess errors:
cc1plus: out of memory allocating 1048344 bytes after a total of 7913472 bytes

It turns out that this exhaustion of the 32-bit address space happens
due to a combination of three issues:

* the SPARC pagesize of 8 kB,

* ggc-page.cc's chunk size of 512 * pagesize, i.e. 4 MB, and

* mmap adding two 8 kB unmapped red-zone pages to each mapping

which result in the 4 MB mappings to actually consume 4.5 MB of address
space.

To avoid this, this patch reduces the chunk size so it remains at 4 MB
even when combined with the red-zone pages, as recommended by mmap(2).

Tested on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11, committed
to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-29  Rainer Orth  

gcc:
PR c++/115031
* config/sparc/sol2.h (GGC_QUIRE_SIZE): Define as 510.

# HG changeset patch
# Parent  5c140588dce73c5358387df3bb9597de45fa5524
ggc: Reduce GGC_QUIRE_SIZE on 32-bit Solaris/SPARC [PR115031]

diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -38,6 +38,9 @@ along with GCC; see the file COPYING3.  
 #undef SPARC_DEFAULT_CMODEL
 #define SPARC_DEFAULT_CMODEL CM_MEDMID
 
+/* Redue ggc-page.cc's chunk size to account for mmap red-zone pages.  */
+#define GGC_QUIRE_SIZE 510
+
 /* Select a format to encode pointers in exception handling data.  CODE
is 0 for data, 1 for code labels, 2 for function pointers.  GLOBAL is
true if the symbol may be affected by dynamic relocations.


[PATCH] libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables [PR111641]

2024-05-28 Thread Rainer Orth
Several of the 19_diagnostics/stacktrace tests FAIL on Solaris/SPARC (32
and 64-bit), Solaris/x86 (32-bit only), and several other targets:

FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++26 execution test

As it turns out, both the copy of libbacktrace in libstdc++ and the
testcases proper need to compiled with -funwind-tables, as is done for
libbacktrace itself.

This isn't an issue on Linux/x86_64 and Solaris/amd64 since 64-bit x86
always defaults to -funwind-tables.  32-bit x86 does, too, when
-fomit-frame-pointer is enabled as on Linux/i686, but unlike
Solaris/i386.

So this patch always enables the option both for the libbacktrace copy
and the testcases.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-23  Rainer Orth  

libstdc++-v3:
PR libstdc++/111641
* src/libbacktrace/Makefile.am (AM_CFLAGS): Add -funwind-tables.
* src/libbacktrace/Makefile.in: Regenerate.

* testsuite/19_diagnostics/stacktrace/current.cc (dg-options): Add
-funwind-tables.
* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/hash.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/output.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.

# HG changeset patch
# Parent  a0526be1377da6b48eacbdd53f1d0e0b02ddb731
libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables [PR111641]

diff --git a/libstdc++-v3/src/libbacktrace/Makefile.am b/libstdc++-v3/src/libbacktrace/Makefile.am
--- a/libstdc++-v3/src/libbacktrace/Makefile.am
+++ b/libstdc++-v3/src/libbacktrace/Makefile.am
@@ -51,7 +51,7 @@ C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-pr
 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = \
 	$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-	$(C_WARN_FLAGS)
+	$(C_WARN_FLAGS) -funwind-tables
 AM_CFLAGS += $(EXTRA_CFLAGS)
 AM_CXXFLAGS = \
 	$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
diff --git a/libstdc++-v3/src/libbacktrace/Makefile.in b/libstdc++-v3/src/libbacktrace/Makefile.in
--- a/libstdc++-v3/src/libbacktrace/Makefile.in
+++ b/libstdc++-v3/src/libbacktrace/Makefile.in
@@ -473,7 +473,7 @@ libstdc___libbacktrace_la_CPPFLAGS = \
 C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-unused-but-set-variable
 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-	$(C_WARN_FLAGS) $(EXTRA_CFLAGS)
+	$(C_WARN_FLAGS) -funwind-tables $(EXTRA_CFLAGS)
 AM_CXXFLAGS = $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
 	$(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions $(EXTRA_CXXFLAGS)
 obj_prefix = std_stacktrace
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/current.cc b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/current.cc
--- a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/current.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/current.cc
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc
--- a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/hash.cc b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/hash.cc
--- a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/hash.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/hash.cc
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/output.cc b/libstdc++-v3/testsuite/19_diagnostics/stac

Re: [RFC 0/2] libbacktrace: add FDPIC support

2024-05-27 Thread Rainer Orth
Hi Max,

> This is an RFC series that adds FDPIC ELF target support to
> libbacktrace.
>
> While debugging this I've noticed that there's no unwinding info for the
> libstdc++ version of libbacktrace, which made backtraces empty for me,
> both on xtensa-linux-uclibcfdpic and on regular xtensa-linux-uclibc.
> Adding -funwind-tables to the libstdc++ version of libbacktrace fixed
> that. Which makes me wonder how it works for other architectures?

it doesn't ;-(  See PR libstdc++/111641 for details.  There's a patch in
there, too.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] testsuite: vect: Fix gcc.dg/vect/vect-pr111779.c on SPARC [PR114072]

2024-05-23 Thread Rainer Orth
gcc.dg/vect/vect-pr111779.c FAILs on 32 and 64-bit Solaris/SPARC:

FAIL: gcc.dg/vect/vect-pr111779.c -flto -ffat-lto-objects  scan-tree-dump vect 
"LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-pr111779.c scan-tree-dump vect "LOOP VECTORIZED"

This patch implements Richard's analysis from the PR, skipping the
scan-tree-dump part for big-endian targets without vect_shift_char
support.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (32 and 64-bit each).

Committed to trunk as pre-approved in the PR.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-22  Rainer Orth  

gcc/testsuite:
PR tree-optimization/114072
* gcc.dg/vect/vect-pr111779.c (scan-tree-dump): Require
vect_shift_char on big-endian targets.

# HG changeset patch
# Parent  1f3d09b9a831993fdfb155ebf7a4e540201d9f76
testsuite: vect: Fix gcc.dg/vect/vect-pr111779.c on SPARC [PR114072]

diff --git a/gcc/testsuite/gcc.dg/vect/vect-pr111779.c b/gcc/testsuite/gcc.dg/vect/vect-pr111779.c
--- a/gcc/testsuite/gcc.dg/vect/vect-pr111779.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-pr111779.c
@@ -53,4 +53,4 @@ main ()
   return 0;
 }
 
-/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_int } } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_int && { le || { be && vect_shift_char } } } } } } */


[PATCH] testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

2024-05-21 Thread Rainer Orth
gcc.dg/pr115066.c currently FAILs on Solaris/SPARC with the native as:

FAIL: gcc.dg/pr115066.c scan-assembler .bytet0xbt# Define macro strx

Instead of the expected

.byte   0xb ! Define macro strx

the assembler output contains

.byte   0x1 ! Define macro

Apparently this happens because the Solaris as/ld combo doesn't support
SHF_MERGE.

While I initially meant to just skip the test on sparc*-*-solaris2* && !gas,
Tom suggested to allow for both forms instead, which is what his patch
does.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (as and gas
each) and x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-21  Tom de Vries  

gcc/testsuite:
PR debug/115066
* gcc.dg/pr115066.c (scan-assembler): Allow for alternative form
of Define macro.

# HG changeset patch
# Parent  630ea4594490d9bd4911b95d13eaca62a8cd4dba
testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

diff --git a/gcc/testsuite/gcc.dg/pr115066.c b/gcc/testsuite/gcc.dg/pr115066.c
--- a/gcc/testsuite/gcc.dg/pr115066.c
+++ b/gcc/testsuite/gcc.dg/pr115066.c
@@ -3,6 +3,6 @@
 /* { dg-options "-gsplit-dwarf -g3 -dA -gdwarf-4" } */
 /* { dg-final { scan-assembler-times {\.section\t"?\.debug_macro} 1 } } */
 /* { dg-final { scan-assembler-not {\.byte\t0x5\t[^\n\r]* Define macro strp} } } */
-/* { dg-final { scan-assembler {\.byte\t0xb\t[^\n\r]* Define macro strx} } } */
+/* { dg-final { scan-assembler {\.byte\t0xb\t[^\n\r]* Define macro strx|\.byte\t0x1\t[^\n\r]* Define macro} } } */
 
 #define foo 1


[COMMITTED] testsuite: Require lto-plugin in gcc.dg/ipa/ipa-icf-38.c [PR85656]

2024-05-15 Thread Rainer Orth
gcc.dg/ipa/ipa-icf-38.c currently FAILs on Solaris (SPARC and x86, 32
and 64-bit):

FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not optimized "Function bar"

As it turns out, this only happens when the Solaris linker is used; with
GNU ld the test PASSes just fine.  In fact, that happens because gld
supports the lto-plugin while ld does not: in a Solaris build with gld,
the test FAILs the same way as with ld when -fno-use-linker-plugin is
passed, so this patch requires linker_plugin.

Tested on i386-pc-solaris2.11 (ld and gld) and x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-15  Rainer Orth  

gcc/testsuite:
PR ipa/85656
* gcc.dg/ipa/ipa-icf-38.c: Require linker_plugin.

# HG changeset patch
# Parent  e546887285f7d120135d24bedb991846e571a536
testsuite: Require lto-plugin in gcc.dg/ipa/ipa-icf-38.c [PR85656]

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
@@ -2,6 +2,7 @@
 /* { dg-require-alias "" } */
 /* { dg-options "-O2 -fdump-ipa-icf-optimized -flto -fdump-tree-optimized -fno-ipa-vrp" } */
 /* { dg-require-effective-target lto } */
+/* { dg-require-effective-target linker_plugin } */
 /* { dg-additional-sources "ipa-icf-38a.c" }*/
 
 /* Based on ipa-icf-3.c.  */


[COMMITTED] testsuite: i386: Fix g++.target/i386/pr97054.C on Solaris

2024-05-15 Thread Rainer Orth
g++.target/i386/pr97054.C currently FAILs on 64-bit Solaris/x86:

FAIL: g++.target/i386/pr97054.C  -std=gnu++14 (test for excess errors)
UNRESOLVED: g++.target/i386/pr97054.C  -std=gnu++14 compilation failed to 
produce executable
FAIL: g++.target/i386/pr97054.C  -std=gnu++17 (test for excess errors)
UNRESOLVED: g++.target/i386/pr97054.C  -std=gnu++17 compilation failed to 
produce executable
FAIL: g++.target/i386/pr97054.C  -std=gnu++2a (test for excess errors)
UNRESOLVED: g++.target/i386/pr97054.C  -std=gnu++2a compilation failed to 
produce executable
FAIL: g++.target/i386/pr97054.C  -std=gnu++98 (test for excess errors)
UNRESOLVED: g++.target/i386/pr97054.C  -std=gnu++98 compilation failed to 
produce executable

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/g++.target/i386/pr97054.C:49:20: 
error: frame pointer required, but reserved

Since Solaris/x86 defaults to -fno-omit-frame-pointer, this patch
explicitly builds with -fomit-frame-pointer as is the default on other
x86 targets.

Tested on i386-pc-solaris2.11 (32 and 64-bit) and x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-15  Rainer Orth  

gcc/testsuite:
* g++.target/i386/pr97054.C (dg-options): Add -fomit-frame-pointer.

# HG changeset patch
# Parent  4a47ed944a7c277f84f13551c7413f481a71877e
testsuite: i386: Fix g++.target/i386/pr97054.C on Solaris

diff --git a/gcc/testsuite/g++.target/i386/pr97054.C b/gcc/testsuite/g++.target/i386/pr97054.C
--- a/gcc/testsuite/g++.target/i386/pr97054.C
+++ b/gcc/testsuite/g++.target/i386/pr97054.C
@@ -1,6 +1,6 @@
 // { dg-do run { target { ! ia32 } } }
 // { dg-require-effective-target fstack_protector }
-// { dg-options "-O2 -fno-strict-aliasing -msse4.2 -mfpmath=sse -fPIC -fstack-protector-strong -O2" }
+// { dg-options "-O2 -fno-strict-aliasing -msse4.2 -mfpmath=sse -fPIC -fstack-protector-strong -O2 -fomit-frame-pointer" }
 
 struct p2_icode *ipc;
 register int pars asm("r13");


[PATCH] testsuite: analyzer: Fix fd-glibc-byte-stream-connection-server.c on Solaris [PR107750]

2024-05-14 Thread Rainer Orth
gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c currently FAILs
on Solaris:

FAIL: gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c (test for excess 
errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:91:3:
 error: implicit declaration of function 'memset' 
[-Wimplicit-function-declaration]

Solaris  has

#define FD_ZERO(__p)(void) memset((__p), 0, sizeof (*(__p))) 

but no declaration of memset.  While one can argue that this should be
fixed, it's easy enough to just include  instead, which is
what this patch does.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-14  Rainer Orth  

gcc/testsuite:
PR analyzer/107750
* gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:
Include .

# HG changeset patch
# Parent  4d8ceef2997b0a0ff7a4b4df140f9f864e923eb4
testsuite: analyzer: Fix fd-glibc-byte-stream-connection-server.c on Solaris [PR107750]

diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
--- a/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
+++ b/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c
@@ -6,6 +6,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #if __has_include()


Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-13 Thread Rainer Orth
Hi Nathaniel,

>> > There are a couple of other tests that appear to potentially have a
>> > similar issue:
>> >
>> > global-2_a.C
>> > 21:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^\n']*'
>> > added} module } }
>> >
>> > global-3_a.C
>> > 15:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^'\n]*'
>> > added} module } }
>> 
>> neither module file contains "Reachable GMF" at all, with ::printf or
>> otherwise.
>> 
>
> Yes, I think the test is aiming to check that such a declaration is not
> added at all, and so that's correct. But if for some reason on some
> system it did add "::std::printf" that would be a bug that would not be
> caught by this test.

understood.  However, the question about global-3_a.C remains which
contains no printf at all.

>> > Which I suppose maybe also should be updated in the same way; I guess
>> > they don't fail on Solaris because they aren't actually correctly
>> > testing what they think they are.
>> 
>> Perhaps, but it would be useful to first understand what those tests are
>> supposed to look like.  WRT global-3_a.C, printf doesn't occur at all,
>> so this may just be a case of copy-and-paste.
>> 
>> Maybe Nathan, who authored the tests, can shed some light.
>> 
>> > Otherwise LGTM.
>> 
>> Thanks.  I'll go ahead and commit the patch as is, asjusting the other
>> two once it's become clear what they should look like.
>> 
>
> Ah, I should have been clearer: I'm not sure I can approve, but I've
> CC'd Jason in.

Sorry, I already committed the patch.  I can revert, of course, if
that's inappropriate.  OTOH, it could be considered obvious ;-)

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-13 Thread Rainer Orth
Hi Nathaniel,

> On Mon, May 13, 2024 at 10:40:30AM +0200, Rainer Orth wrote:
>> g++.dg/modules/stdio-1_a.H currently FAILs on Solaris:
>> 
>> FAIL: g++.dg/modules/stdio-1_a.H -std=c++17  scan-lang-dump module "Depset:0 
>> decl entity:[0-9]* function_decl:'::printf'"
>> FAIL: g++.dg/modules/stdio-1_a.H -std=c++2a  scan-lang-dump module "Depset:0 
>> decl entity:[0-9]* function_decl:'::printf'"
>> FAIL: g++.dg/modules/stdio-1_a.H -std=c++2b  scan-lang-dump module "Depset:0 
>> decl entity:[0-9]* function_decl:'::printf'"
>> 
>> The problem is that the module file doesn't contain
>> 
>>  Depset:0 decl entity:95 function_decl:'::printf'
>> 
>> as expected by the test, but
>> 
>>  Depset:0 decl entity:26 function_decl:'::std::printf'
>> 
>> This happens because Solaris  declares printf in namespace std
>> as allowed by C++11, Annex D, D.5.
>> 
>> This patch allows for both forms.
>> 
>> Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
>> x86_64-pc-linux-gnu.
>> 
>> Ok for trunk?
>> 
>>  Rainer
>
> There are a couple of other tests that appear to potentially have a
> similar issue:
>
> global-2_a.C
> 21:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^\n']*'
> added} module } }
>
> global-3_a.C
> 15:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^'\n]*'
> added} module } }

neither module file contains "Reachable GMF" at all, with ::printf or
otherwise.

> Which I suppose maybe also should be updated in the same way; I guess
> they don't fail on Solaris because they aren't actually correctly
> testing what they think they are.

Perhaps, but it would be useful to first understand what those tests are
supposed to look like.  WRT global-3_a.C, printf doesn't occur at all,
so this may just be a case of copy-and-paste.

Maybe Nathan, who authored the tests, can shed some light.

> Otherwise LGTM.

Thanks.  I'll go ahead and commit the patch as is, asjusting the other
two once it's become clear what they should look like.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-13 Thread Rainer Orth
g++.dg/modules/stdio-1_a.H currently FAILs on Solaris:

FAIL: g++.dg/modules/stdio-1_a.H -std=c++17  scan-lang-dump module "Depset:0 
decl entity:[0-9]* function_decl:'::printf'"
FAIL: g++.dg/modules/stdio-1_a.H -std=c++2a  scan-lang-dump module "Depset:0 
decl entity:[0-9]* function_decl:'::printf'"
FAIL: g++.dg/modules/stdio-1_a.H -std=c++2b  scan-lang-dump module "Depset:0 
decl entity:[0-9]* function_decl:'::printf'"

The problem is that the module file doesn't contain

 Depset:0 decl entity:95 function_decl:'::printf'

as expected by the test, but

 Depset:0 decl entity:26 function_decl:'::std::printf'

This happens because Solaris  declares printf in namespace std
as allowed by C++11, Annex D, D.5.

This patch allows for both forms.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-13  Rainer Orth  

gcc/testsuite:
PR c++/98529
* g++.dg/modules/stdio-1_a.H (scan-lang-dump): Allow for
::std::printf.

diff --git a/gcc/testsuite/g++.dg/modules/stdio-1_a.H b/gcc/testsuite/g++.dg/modules/stdio-1_a.H
--- a/gcc/testsuite/g++.dg/modules/stdio-1_a.H
+++ b/gcc/testsuite/g++.dg/modules/stdio-1_a.H
@@ -10,5 +10,5 @@
 #endif
 // There should be *lots* of depsets (209 for glibc today)
 // { dg-final { scan-lang-dump {Writing section:60 } module } }
-// { dg-final { scan-lang-dump {Depset:0 decl entity:[0-9]* function_decl:'::printf'} module } }
+// { dg-final { scan-lang-dump {Depset:0 decl entity:[0-9]* function_decl:'(::std)?::printf'} module } }
 // { dg-final { scan-lang-dump {Depset:1 binding namespace_decl:'::printf'} module } }


Re: gcc/DATESTAMP wasn't updated since 20240507

2024-05-13 Thread Rainer Orth
Richard Biener  writes:

> On Thu, 9 May 2024, Jakub Jelinek wrote:
>
>> On Thu, May 09, 2024 at 12:14:43PM +0200, Jakub Jelinek wrote:
>> > On Thu, May 09, 2024 at 12:04:38PM +0200, Rainer Orth wrote:
>> > > I just noticed that gcc/DATESTAMP wasn't updated yesterday and today,
>> > > staying at 20240507.
>> > 
>> > I think it is because of the r15-268 commit, we do support
>> > This reverts commit ...
>> > when the referenced commit contains a ChangeLog message, but here
>> > it doesn't, as it is a revert commit.
>> 
>> Indeed and also the r15-311 commit.
>> Please don't Revert Revert, we don't really support that, had to fix it all
>> by hand.
>
> I do wonder if we can run the ChangeLog processing checks as part of
> the pre-commit hook and reject such pushes.  It seems we have two
> implementations, one in the pre-commit hook and the processing itself
> rather than having a single implementation that can run in two modes?

Unfortunately, the datestamp is again stuck at 20240509.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Hi Jan,

> On Friday 2024-05-10 15:59, Rainer Orth wrote:
>>Stuff Received  writes:
>>
>>> On 2024-05-10 07:44, Rainer Orth wrote (in part):
>>>
>>>> Besides, if John had ever tried to build either GCC 13 or 14 on Solaris
>>>> 11.3, gcc/configure would have told him about the obsoletion in no
>>>> uncertain terms.
>>>
>>> No, the option --enable-obsolete has allowed me to build on my T2000
>>> running Solaris 11.3 until recently.  (I just built GCC 14.1.0 on said 
>>> machine.)
>>
>>of course, but with default options you get a message indicating the
>>obsoletion:
>>
>>  echo "*** Configuration ${target}${target_min} is obsolete." >&2
>>  echo "*** Specify --enable-obsolete to build it anyway." >&2
>>  echo "*** Support will be REMOVED in the next major release of GCC," >&2
>>  echo "*** unless a maintainer comes forward." >&2
>>
>>So nobody can say they didn't know about the obsoletion.
>
> I can. With my distro hat on, I can tell you that, when rpmbuild/dpkg-build*
> completes with exit status 0, there certainly is much reduced incentive to go
> looking at the build log.

but without --enable-obsolete (which is off by default), the build will
abort with exit 1 on an obsolete target.  This simply cannot be
overlooked.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Stuff Received  writes:

> On 2024-05-10 07:44, Rainer Orth wrote (in part):
>
>> Besides, if John had ever tried to build either GCC 13 or 14 on Solaris
>> 11.3, gcc/configure would have told him about the obsoletion in no
>> uncertain terms.
>
> No, the option --enable-obsolete has allowed me to build on my T2000
> running Solaris 11.3 until recently.  (I just built GCC 14.1.0 on said 
> machine.)

of course, but with default options you get a message indicating the
obsoletion:

  echo "*** Configuration ${target}${target_min} is obsolete." >&2
  echo "*** Specify --enable-obsolete to build it anyway." >&2
  echo "*** Support will be REMOVED in the next major release of GCC," >&2
  echo "*** unless a maintainer comes forward." >&2

So nobody can say they didn't know about the obsoletion.

    Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Hi Adrian,

>> > While Oracle does no longer provide feature updates to Solaris 11.3, there
>> > is still LTSS security support so that users still receive security updates
>> > so that their systems are continued to be protected against 
>> > vulnerabilities.
>> 
>> The Solaris 11.3 ESUs (Extended Support Updates) are available at a
>> premium only, and just contain the bare minimum of security updates,
>> often 6 to 9 month in between.
>
> That's not an argument for throwing away hardware that still works perfectly
> fine and that still has some users.

who talks about throwing away the hardware: just keep it running with
the latest available OS and GCC and be done with it.  You still refused
to explain what's the *need* for GCC > 14 on Solaris 11.3.  Nice to have
maybe, but crucial?

>> > I think Solaris 11.3 support should be kept since the resulting code 
>> > removal
>> > is not that large that it would justify dropping support for such a large
>> > userbase.
>> 
>> Do you have any indication on the size of the userbase?  I seriously
>> doubt it's large beyond some hobbyists that keep the old hardware
>> running.
>
> I don't have the exact numbers, no. But I know there are many users out there
> with pre-11.4 hardware that they still use. As you may know, there are no
> 11.4 SPARC desktop systems and most 11.4-capable hardware is usually very
> expensive.

Sure, and they are free to to so.  I've been running Solaris/SPARC
desktops for a long time myself, like an Ultra 1 or a Blade 1500.
However, once OS support was gone, I stopped and moved on.

>> You also seem to forget that my GCC (and LLVM) Solaris support work is
>> purely voluntary, done in my spare time.
>
> Not sure what makes you think so. I'm perfectly aware of the fact that lots of
> people do this work in their spare time as this applies to me as well.
>
> I'm not getting paid for my Debian work, my kernel maintenance and all the 
> other
> stuff that I'm doing either. That doesn't mean users are not allowed to ask me
> questions or send me comments about my work.

Who talks about being allowed?  But you spend your time on your
Debian/sparc64 work as you see fit, and so do I.  There's only so much
time in a day, and sometime it's nice to have a private life, too.
There's simply no time left with me for keeping S11.3 support going, so
it stops.  It's that simple.

>> Keeping Solaris 11.3 support working would be much more than restoring
>> the removal patch:
>> 
>> * For each and every of my Solaris patches, I'd have to investigate if
>>   it works on 11.3 or needs adjustments and workarounds.
>> 
>> * I'd also need to regularly test the result to keep things working.
>> 
>> I honestly don't have the time or the energy to do this, nor the
>> hardware required for testing  Besides, I have too much on my plate
>> already, and rather spend it on more beneficial work.
>
> Does Solaris support in GCC really change that often that the necessary tests
> cannot be run by volunteers? I'd be happy to test changes for Solaris 11.3
> which can be installed inside an LDOM.

Hardware is just one concern here, but the limiting factor is my time.
No argument from you can increase that.

>> Above all, I always wonder why people insist on running ancient hardware
>> with an almost-unsupported OS, but require a bleeding edge version of
>> GCC.  What's wrong with continuing to use GCC 13 (or even 14, although I
>> haven't tested that on Solaris 11.3) instead?
>
> You could also ask why people use operating systems other than Linux and
> architectures other than x86_64. I don't think you will get a satisfactory
> answer to that question.

The question is who is doing the work.  As long as there's someone who
does, fine, if not then support for those OSes dies (I've had that for
both IRIX and Tru64 Unix in the past, btw.).

>> > Removing Solaris 11.3 support might make sense in the future when SPARC
>> > support in Illumos has matured enough that people can switch over their
>> > machines.
>> 
>> As has been noted, SPARC is on its way out for Illumos.
>
> Which makes my point to keep Solaris 11.3 support even more valid.

You can keep wishing, but I won't be doing the work.  It's that simple.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Hi John,

> On Fri, 2024-05-10 at 12:14 +0200, Richard Biener wrote:
>> > Because I wasn't subscribed to gcc-patches and I'm also only subscribed now
>> > without receiving messages due to the large message volume on this list.
>> 
>> https://gcc.gnu.org/gcc-13/changes.html
>> 
>> > The problem with announcements on developer mailing lists is usually
>> > that they
>> > usually don't reach any users. I was made aware of this change only when I
>> > checked about the recent changes to GCC Git.
>> 
>> Where do you expect such announcement then?
>
> That's a difficult question, to be honest. From a user perspective, it's hard 
> to
> track these upstream announcements. I would argue that most users don't follow
> all such changes in the upstream projects they are using and, to be honest,
> I really
> wouldn't have expected that Solaris 11.3 would be considered obsolete.

users don't have to follow such announcements at all unless they build
GCC from source.  And those that do better should.  As I mentioned, if
they try, they'll get the info from configure anyway.

> If it had been for Solaris 7, 8 or 9, I would totally understand. But even
> Solaris 10
> is something that Oracle still supports [1].

Right, and you pay an arm and a leg for that.  Yet, Solaris 10 support
was removed from GCC 10 back in 2019 without much fuss.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Hi Richard,

> On Fri, May 10, 2024 at 10:54 AM John Paul Adrian Glaubitz
>  wrote:
>>
>> Hello Rainer,
>>
>> On Fri, 2024-05-10 at 10:20 +0200, Rainer Orth wrote:
>> > > > Support for Solaris 11.3 had already been obsoleted in GCC 13.  
>> > > > However,
>> > > > since the only Solaris system in the cfarm was running 11.3, I've kept
>> > > > it in tree until now when both Solaris 11.4/SPARC and x86 systems have
>> > > > been added.
>> > > >
>> > > > This patch actually removes the Solaris 11.3 support.
>> > >
>> > > I'm not sure I like this change since Solaris 11.3 is the last version of
>> > > Solaris supported by a large number of SPARC systems.
>> > >
>> > > Oracle unfortunately raised the hardware baseline with Solaris 11.4 such
>> > > that every system older than the SPARC T4 is no longer supported by 11.4
>> > > while 11.3 still runs perfectly fine on these machines.
>> >
>> > I wonder why you didn't raise your concerns 1 1/2 years ago when I
>> > announced the obsoletion of Solaris 11.3 support?
>>
>> Because I wasn't subscribed to gcc-patches and I'm also only subscribed now
>> without receiving messages due to the large message volume on this list.
>
> https://gcc.gnu.org/gcc-13/changes.html

exactly, and the announcement also went to the main gcc list:

https://gcc.gnu.org/pipermail/gcc/2022-December/240322.html

No need to follow gcc-patches at all.

Besides, if John had ever tried to build either GCC 13 or 14 on Solaris
11.3, gcc/configure would have told him about the obsoletion in no
uncertain terms.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-10 Thread Rainer Orth
Hi John,

>> Support for Solaris 11.3 had already been obsoleted in GCC 13.  However,
>> since the only Solaris system in the cfarm was running 11.3, I've kept
>> it in tree until now when both Solaris 11.4/SPARC and x86 systems have
>> been added.
>> 
>> This patch actually removes the Solaris 11.3 support.
>
> I'm not sure I like this change since Solaris 11.3 is the last version of
> Solaris supported by a large number of SPARC systems.
>
> Oracle unfortunately raised the hardware baseline with Solaris 11.4 such
> that every system older than the SPARC T4 is no longer supported by 11.4
> while 11.3 still runs perfectly fine on these machines.

I wonder why you didn't raise your concerns 1 1/2 years ago when I
announced the obsoletion of Solaris 11.3 support?

> While Oracle does no longer provide feature updates to Solaris 11.3, there
> is still LTSS security support so that users still receive security updates
> so that their systems are continued to be protected against vulnerabilities.

The Solaris 11.3 ESUs (Extended Support Updates) are available at a
premium only, and just contain the bare minimum of security updates,
often 6 to 9 month in between.

> I think Solaris 11.3 support should be kept since the resulting code removal
> is not that large that it would justify dropping support for such a large
> userbase.

Do you have any indication on the size of the userbase?  I seriously
doubt it's large beyond some hobbyists that keep the old hardware
running.

You also seem to forget that my GCC (and LLVM) Solaris support work is
purely voluntary, done in my spare time.

Keeping Solaris 11.3 support working would be much more than restoring
the removal patch:

* For each and every of my Solaris patches, I'd have to investigate if
  it works on 11.3 or needs adjustments and workarounds.

* I'd also need to regularly test the result to keep things working.

I honestly don't have the time or the energy to do this, nor the
hardware required for testing  Besides, I have too much on my plate
already, and rather spend it on more beneficial work.

Above all, I always wonder why people insist on running ancient hardware
with an almost-unsupported OS, but require a bleeding edge version of
GCC.  What's wrong with continuing to use GCC 13 (or even 14, although I
haven't tested that on Solaris 11.3) instead?

> Removing Solaris 11.3 support might make sense in the future when SPARC
> support in Illumos has matured enough that people can switch over their
> machines.

As has been noted, SPARC is on its way out for Illumos.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


gcc/DATESTAMP wasn't updated since 20240507

2024-05-09 Thread Rainer Orth
I just noticed that gcc/DATESTAMP wasn't updated yesterday and today,
staying at 20240507.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] build: Derive object names in make_sunver.pl

2024-05-07 Thread Rainer Orth
The recent move of libgfortran object files to subdirs and the resulting
breakage of libgfortran.so symbol exports demonstrated how fragile
deriving object and archive names from their libtool counterparts in the
Makefiles is.  Therefore, this patch moves that step into
make_sunver.pl, considerably simplifying the Makefile rules to create
the version scripts.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11, verifying that the version scripts are identical
except for the input filenames.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-06  Rainer Orth  

contrib:
* make_sunver.pl: Use File::Basename;
Skip -lLIB args.
Convert libtool object/archive names to underlying
objects/archives.

libatomic:
* Makefile.am [LIBAT_BUILD_VERSIONED_SHLIB_SUN]
(libatomic.map-sun): Pass $(libatomic_la_OBJECTS),
$(libatomic_la_LIBADD) to make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libffi:
* Makefile.am [LIBFFI_BUILD_VERSIONED_SHLIB_SUN] (libffi.map-sun):
Pass $(libffi_la_OBJECTS), $(libffi_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libgfortran:
* Makefile.am [LIBGFOR_USE_SYMVER_SUN} (gfortran.ver-sun): Pass
$(libgfortran_la_OBJECTS), $(libgfortran_la_LIBADD) to
make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libgomp:
* Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]
(libgomp.ver-sun): Pass $(libgomp_la_OBJECTS),
$(libgomp_la_LIBADD) to make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libitm:
* Makefile.am [LIBITM_BUILD_VERSIONED_SHLIB_SUN] (libitm.map-sun):
Pass $(libitm_la_OBJECTS), $(libitm_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libquadmath:
* Makefile.am [LIBQUAD_USE_SYMVER_SUN] (quadmath.map-sun): Pass
$(libquadmath_la_OBJECTS), $(libquadmath_la_LIBADD) to
make_sunver.pl unmodified.
* Makefile.in: Regenerate.

libssp:
* Makefile.am [LIBSSP_USE_SYMVER_SUN] (ssp.map-sun): Pass
$(libssp_la_OBJECTS), $(libssp_la_LIBADD) to make_sunver.pl
unmodified.
* Makefile.in: Regenerate.

libstdc++-v3:
* src/Makefile.am [ENABLE_SYMVERS_SUN]
(libstdc++-symbols.ver-sun): Pass $(libstdc___la_OBJECTS),
$(libstdc___la_LIBADD) to make_sunver.pl unmodified.
* src/Makefile.in: Regenerate.

# HG changeset patch
# Parent  760a45ebd3104e6b2f5f739e62790ce1a4e7f33b
build: Derive object names in make_sunver.pl

diff --git a/contrib/make_sunver.pl b/contrib/make_sunver.pl
--- a/contrib/make_sunver.pl
+++ b/contrib/make_sunver.pl
@@ -17,6 +17,7 @@
 # GNU mangling style.
 
 use FileHandle;
+use File::Basename;
 use IPC::Open2;
 
 # Enforce C locale.
@@ -37,12 +38,22 @@ my @OBJECTS = ();
 # List of shared objects to omit from processing.
 my @SHAREDOBJS = ();
 
-# Filter out those input archives that have corresponding shared objects to
-# avoid adding all symbols matched in the archive to the output map.
 foreach $file (@ARGV) {
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
 if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
 	printf STDERR "omitted $file -> $so\n";
 	push (@SHAREDOBJS, $so);
+# Skip libraries.
+} elsif ($file =~ /^-l/) {
+	next;
+# Convert libtool object/archive names to underlying objects/archives.
+} elsif ($file =~ /\.l[ao]$/) {
+	my ($name, $path, $suffix) = fileparse($file, ".l[ao]");
+	$suffix =~ s/l//;
+	# Strip leading ./ prepended by fileparse.
+	$path =~ s%^\./%%;
+	push (@OBJECTS, "$path.libs/$name$suffix")
 } else {
 	push (@OBJECTS, $file);
 }
diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
--- a/libatomic/Makefile.am
+++ b/libatomic/Makefile.am
@@ -55,9 +55,7 @@ libatomic.map-sun : $(top_srcdir)/libato
 		$(libatomic_la_OBJECTS) $(libatomic_la_LIBADD)
 	perl $(top_srcdir)/../contrib/make_sunver.pl \
 	  $(top_srcdir)/libatomic.map \
-	  $(libatomic_la_OBJECTS:%.lo=.libs/%.o) \
-	 `echo $(libatomic_la_LIBADD) | \
-	sed 's,\([^/ 	]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+	  $(libatomic_la_OBJECTS) $(libatomic_la_LIBADD) \
 	 > $@ || (rm -f $@ ; exit 1)
 endif
 else
diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -888,9 +888,7 @@ vpath % $(strip $(search_path))
 @LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@		$(libatomic_la_OBJECTS) $(libatomic_la_LIBADD)
 @LIBAT_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBAT_BUILD_VERSIONED_SHLIB_TRUE@	

[COMMITTED v2] Remove obsolete Solaris 11.3 support

2024-05-07 Thread Rainer Orth
Rainer Orth  writes:

> Support for Solaris 11.3 had already been obsoleted in GCC 13.  However,
> since the only Solaris system in the cfarm was running 11.3, I've kept
> it in tree until now when both Solaris 11.4/SPARC and x86 systems have
> been added.
>
> This patch actually removes the Solaris 11.3 support.  Apart from
> several minor simplifications, there are two more widespread changes:
>
> * In Solaris 11.4, libsocket and libnsl were folded into libc, so
>   there's no longer a need to link them explictly.
>
> * Since Solaris 11.4, Solaris includes all crts needed by gcc (like
>   crt1.o and gcrt1.o) with the base system.  All workarounds to provide
>   fallbacks can thus go.

During a last review immediately before commit, I noticed two errors
(not regenerating one configure script, omitting a snippet mentioned in
the ChangeLog).

I also noticed a few additional cleanups: completely removing
gcc_cv_aligned_shf_merge, unconditionally setting
gcc_cv_target_dl_iterate_phdr which this version incorporates.

v2 patch was retested as before and committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-30  Rainer Orth  

c++tools:
* configure.ac (ax_lib_socket_nsl.m4): Don't sinclude.
(AX_LIB_SOCKET_NSL): Don't call.
(NETLIBS): Remove.
* configure: Regenerate.
* Makefile.in (NETLIBS): Remove.
(g++-mapper-server$(exeext)): Remove $(NETLIBS).

gcc:
* config.gcc: Move *-*-solaris2.11.[0-3]* to unsupported list.
<*-*-solaris2*> (default_use_cxa_atexit): Set unconditionally.
* configure.ac (AX_LIB_SOCKET_NSL): Don't call.
(NETLIBS): Remove.
(gcc_cv_ld_aligned_shf_merge): Remove.
(hidden_linkonce) : Remove.
(gcc_cv_target_dl_iterate_phdr) <*-*-solaris2*>: Always set to yes.
* Makefile.in (NETLIBS): Remove.
* configure, config.in, aclocal.m4: Regenerate.
* config/sol2.h: Don't check HAVE_SOLARIS_CRTS.
(STARTFILE_SPEC): Remove !HAVE_SOLARIS_CRTS case.
[USE_GLD] (LINK_EH_SPEC): Remove TARGET_DL_ITERATE_PHDR guard.
* config/i386/i386.cc (USE_HIDDEN_LINKONCE): Remove guard.
* varasm.cc (mergeable_string_section): Remove
HAVE_LD_ALIGNED_SHF_MERGE handling.
(mergeable_constant_section): Likewise.

* doc/install.texi (Specific,i?86-*-solaris2*): Reference Solaris
11.4 only.
(Specific, *-*-solaris2*): Document Solaris 11.3 removal.  Remove
11.3 references and caveats.  Update for 11.4.

gcc/cp:
* Make-lang.in (cc1plus$(exeext)): Remove $(NETLIBS).

gcc/objcp:
* Make-lang.in (cc1objplus$(exeext)): Remove $(NETLIBS).

gcc/testsuite:
* lib/target-supports.exp (check_effective_target_pie): Always
enable on *-*-solaris2*.

libgcc:
* configure.ac <*-*-solaris2*> (libgcc_cv_solaris_crts): Remove.
* config.host <*-*-solaris2*>: Remove !libgcc_cv_solaris_crts
support.
* configure, config.in: Regenerate.
* config/sol2/gmon.c (internal_mcount) [!HAVE_SOLARIS_CRTS]: Remove.
* config/i386/sol2-c1.S, config/sparc/sol2-c1.S: Remove.
* config/sol2/t-sol2 (crt1.o, gcrt1.o): Remove.

libstdc++-v3:
* testsuite/lib/dg-options.exp (add_options_for_net_ts)
<*-*-solaris2*>: Don't link with -lsocket -lnsl.

# HG changeset patch
# Parent  0b3c1bdf2ccf6df4efd873f00e86c3c854083c3e
Remove obsolete Solaris 11.3 support

diff --git a/c++tools/Makefile.in b/c++tools/Makefile.in
--- a/c++tools/Makefile.in
+++ b/c++tools/Makefile.in
@@ -35,7 +35,6 @@ CXXOPTS := $(CXXFLAGS) $(PICFLAG) -fno-e
 LDFLAGS := @LDFLAGS@
 exeext := @EXEEXT@
 LIBIBERTY := ../libiberty/libiberty.a
-NETLIBS := @NETLIBS@
 VERSION.O := ../gcc/version.o
 
 all::
@@ -99,7 +98,7 @@ MAPPER.O := server.o resolver.o
 CODYLIB = ../libcody/libcody.a
 CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
 g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
-	+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
+	+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY)
 
 # copy to gcc dir so tests there can run
 all::../gcc/g++-mapper-server$(exeext)
diff --git a/c++tools/configure b/c++tools/configure
--- a/c++tools/configure
+++ b/c++tools/configure
@@ -622,7 +622,6 @@ ac_includes_default="\
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
-NETLIBS
 get_gcc_base_ver
 EGREP
 GREP
@@ -1670,52 +1669,6 @@ eval ac_res=\$$3
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_cxx_check_header_compile
-
-# ac_fn_cxx_try_link LINENO
-# -
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_

Re: [PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs

2024-05-06 Thread Rainer Orth
Hi FX,

>> This patch fixes this by allowing for the new structure.
>> Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.
>> 
>> Ok for trunk?
>
> OK to push, given it’s localised inside LIBGFOR_USE_SYMVER_SUN.
>
> I find it weird though that .libs is harcoded there. If we look at all the
> lib*/Makefile.am in gcc, the only thing that ever needs to specify .libs is
> for Solaris versioning. It feels like it should be more generic, as you say
> (but that’s for longer term).

look again ;-) libgo/Makefile.am has other unrelated instances for both
setting LD_LIBRARY_PATH and related to AIX.

It seems that libtool has no provision for operations other than compile
(create .lo from sources) and link (create executable from libtool
objects/archives).  It you need something else, there's no way but to
reach below the abstraction.  I believe libtool could provide something
like this, but apparently it doesn't.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] libgfortran: Fix libgfortran.so versioning on Solaris with subdirs

2024-05-05 Thread Rainer Orth
The move of libgfortran objects to subdirectories completely broke the
creation of libgfortran.so on Solaris.  Since the gfortran.ver-sun rule
doesn't support that structure, no libtool objects are found, thus no
symbols exported from libgfortran.so, causing every link to fail.

This patch fixes this by allowing for the new structure.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

Ok for trunk?

Btw., I'm the first to admit the current way of performing those
filename/pathname transforms from libtool objects/archives to regular
objects/archives in the Makefiles is incredibly fragile.  It should be
handled in make_sunver.pl itself instead, but for now this needs a quick
fix.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-05  Rainer Orth  

libgfortran:
* Makefile.am [LIBGFOR_USE_SYMVER_SUN] (gfortran.ver-sun): Handle
objects in subdirs.
* Makefile.in: Regenerate.

diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -29,7 +29,7 @@ gfortran.ver-sun : gfortran.ver \
 		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 	perl $(top_srcdir)/../contrib/make_sunver.pl \
 	  gfortran.ver \
-	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 	 `echo $(libgfortran_la_LIBADD) | \
 	sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 	 > $@ || (rm -f $@ ; exit 1)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -4576,7 +4576,7 @@ uninstall-am: uninstall-cafexeclibLTLIBR
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@		$(libgfortran_la_OBJECTS) $(libgfortran_la_LIBADD)
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	perl $(top_srcdir)/../contrib/make_sunver.pl \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  gfortran.ver \
-@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(libgfortran_la_OBJECTS:%.lo=.libs/%.o) \
+@LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	  $(subst /,/.libs/,$(libgfortran_la_OBJECTS:.lo=.o)) \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 `echo $(libgfortran_la_LIBADD) | \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@	 > $@ || (rm -f $@ ; exit 1)


[PATCH] testsuite: c++: Skip g++.dg/analyzer on Solaris [PR111475]

2024-05-05 Thread Rainer Orth
Rainer Orth  writes:

>> On Fri, May 03, 2024 at 09:31:08AM -0400, David Malcolm wrote:
>>> Jakub, Richi, Rainer: this is a non-trivial change that cleans up
>>> analyzer C++ testsuite results on Solaris, but has a slight risk of
>>> affecting analyzer behavior on other targets.  As such, I was thinking
>>> to hold off on backporting it to GCC 14 until after 14.1 is released.
>>> Is that a good plan?
>>
>> Agreed 14.2 is better target than 14.1 for this, especially if committed
>> shortly after 14.1 goes out.
>
> fully agreed: this is way too risky this close to the 14.1 release.  As
> a stop-gap measure, one might consider just skipping the C++ analyzer
> tests on Solaris to avoid the immense number of testsuite failures.

How about this?

Almost 1400 C++ analyzer tests FAIL on Solaris.  The patch is too risky
to apply so close to the GCC 14.1.0 release, so disable the tests on
Solaris instead to reduce the noise.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for gcc-14 branch?

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-05-05  Rainer Orth  

gcc/testsuite:
PR analyzer/111475
* g++.dg/analyzer/analyzer.exp: Disable on *-*-solaris2.*.

diff --git a/gcc/testsuite/g++.dg/analyzer/analyzer.exp b/gcc/testsuite/g++.dg/analyzer/analyzer.exp
--- a/gcc/testsuite/g++.dg/analyzer/analyzer.exp
+++ b/gcc/testsuite/g++.dg/analyzer/analyzer.exp
@@ -24,6 +24,11 @@ if { ![check_effective_target_analyzer] 
 return
 }
 
+# Disable on Solaris until PR analyzer/111475 is fixed.
+if { [istarget *-*-solaris2.*] } {
+return
+}
+
 if [info exists DEFAULT_CXXFLAGS] then {
   set save_default_cxxflags $DEFAULT_CXXFLAGS
 }


Re: [PATCH] testsuite: fix analyzer C++ failures on Solaris [PR111475]

2024-05-03 Thread Rainer Orth
Hi Jakub,

> On Fri, May 03, 2024 at 09:31:08AM -0400, David Malcolm wrote:
>> Jakub, Richi, Rainer: this is a non-trivial change that cleans up
>> analyzer C++ testsuite results on Solaris, but has a slight risk of
>> affecting analyzer behavior on other targets.  As such, I was thinking
>> to hold off on backporting it to GCC 14 until after 14.1 is released.
>> Is that a good plan?
>
> Agreed 14.2 is better target than 14.1 for this, especially if committed
> shortly after 14.1 goes out.

fully agreed: this is way too risky this close to the 14.1 release.  As
a stop-gap measure, one might consider just skipping the C++ analyzer
tests on Solaris to avoid the immense number of testsuite failures.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-02 Thread Rainer Orth
Support for Solaris 11.3 had already been obsoleted in GCC 13.  However,
since the only Solaris system in the cfarm was running 11.3, I've kept
it in tree until now when both Solaris 11.4/SPARC and x86 systems have
been added.

This patch actually removes the Solaris 11.3 support.  Apart from
several minor simplifications, there are two more widespread changes:

* In Solaris 11.4, libsocket and libnsl were folded into libc, so
  there's no longer a need to link them explictly.

* Since Solaris 11.4, Solaris includes all crts needed by gcc (like
  crt1.o and gcrt1.o) with the base system.  All workarounds to provide
  fallbacks can thus go.

There is some additional potential for cleanup which I haven't included
in this patch for various reasons.  I'm Cc'ing the respective
maintainers for guidance instead:

* libgo configure.ac and Makefile.am can now expect HAVE_STAT_TIMESPEC
  to be true and libgo_cv_lib_setcontext_clobbers_tls doesn't apply any
  longer.  Any change would have to go upstream first and I don't know
  about Ian's policy for keeping older versions supported.

* libphobos (libdruntime/gcc/sections/elf.d) has a workaround for the
  lack of struct dl_phdr_info.dlpi_tls_modid.  This was actually added
  in Solaris 11.4 SRU 10 only, so one may or may not want to keep it.

* The same applies to libsanitizer (with a couple of additional
  cleanups).  This would have to go upstream anyway (maybe made
  uncontroversial since LLVM itself never supported Solaris 11.3 itself,
  only allowing some code in to accomodate GCC).

* libstdc++ acinclude.m4 has support for detecting
  glibcxx_cv_math11_{fp,int}_overload.  In Solaris 11.4, those should
  always be true, so one may want to simplify the code accordingly.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11 (as/ld, gas/ld, and gas/gld) as well as Solaris
11.3/x86 to ascertain that version is actually rejected.

Will commit shortly.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-30  Rainer Orth  

c++tools:
* configure.ac (ax_lib_socket_nsl.m4): Don't sinclude.
(AX_LIB_SOCKET_NSL): Don't call.
(NETLIBS): Remove.
* Makefile.in (NETLIBS): Remove.
(g++-mapper-server$(exeext)): Remove $(NETLIBS).

gcc:
* config.gcc: Move *-*-solaris2.11.[0-3]* to unsupported list.
<*-*-solaris2*> (default_use_cxa_atexit): Set unconditionally.
* configure.ac (AX_LIB_SOCKET_NSL): Don't call.
(NETLIBS): Remove.
(gcc_cv_aligned_shf_merge) :
Remove pre-Solaris 11.4 handling.
(hidden_linkonce) : Remove.
* Makefile.in (NETLIBS): Remove.
* configure, config.in, aclocal.m4: Regenerate.
* config/sol2.h: Don't check HAVE_SOLARIS_CRTS.
(STARTFILE_SPEC): Remove !HAVE_SOLARIS_CRTS case.
* config/i386/i386.cc (USE_HIDDEN_LINKONCE): Remove guard.

* doc/install.texi (Specific,i?86-*-solaris2*): Reference Solaris
11.4 only.
(Specific, *-*-solaris2*): Document Solaris 11.3 removal.  Remove
11.3 references and caveats.  Update for 11.4.

gcc/cp:
* Make-lang.in (cc1plus$(exeext)): Remove $(NETLIBS).

gcc/objcp:
* Make-lang.in (cc1objplus$(exeext)): Remove $(NETLIBS).

gcc/testsuite:
* lib/target-supports.exp (check_effective_target_pie): Always
enable on *-*-solaris2*.

libgcc:
* configure.ac <*-*-solaris2*> (libgcc_cv_solaris_crts): Remove.
* config.host <*-*-solaris2*>: Remove !libgcc_cv_solaris_crts
support.
* configure, config.in: Regenerate.
* config/sol2/gmon.c (internal_mcount) [!HAVE_SOLARIS_CRTS]: Remove.
* config/i386/sol2-c1.S, config/sparc/sol2-c1.S: Remove.
* config/sol2/t-sol2 (crt1.o, gcrt1.o): Remove.

libstdc++-v3:
* testsuite/lib/dg-options.exp (add_options_for_net_ts)
<*-*-solaris2*>: Don't link with -lsocket -lnsl.

# HG changeset patch
# Parent  b4a42d2294706a4f32dd6c82bac8717bf0644696
Remove obsolete Solaris 11.3 support

diff --git a/c++tools/Makefile.in b/c++tools/Makefile.in
--- a/c++tools/Makefile.in
+++ b/c++tools/Makefile.in
@@ -35,7 +35,6 @@ CXXOPTS := $(CXXFLAGS) $(PICFLAG) -fno-e
 LDFLAGS := @LDFLAGS@
 exeext := @EXEEXT@
 LIBIBERTY := ../libiberty/libiberty.a
-NETLIBS := @NETLIBS@
 VERSION.O := ../gcc/version.o
 
 all::
@@ -99,7 +98,7 @@ MAPPER.O := server.o resolver.o
 CODYLIB = ../libcody/libcody.a
 CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
 g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
-	+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
+	+$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY)
 
 # copy to gcc dir so tests there can run
 all::../gcc/g++-mapper-server$(exeex

Re: [PATCH] testsuite: gm2: Remove timeout overrides [PR114886]

2024-04-30 Thread Rainer Orth
Hi Gaius,

> yes this looks good to me please apply.  Thanks for the rationale

done for trunk.  I guess it's ok to apply to the gcc-14 branch after the
release and some soak time?

> described in the PR.  As suggested, locally changing site.exp is more
> appropriate should the need arise.  The dg-timeout code was added to
> speed up testing/development of (a deadlocking) RTco.cc (which has
> since been fixed)

Sure: while I've used increased global timeouts in the distant past
(IRIX, old and slow SPARC boxes), it certainly works both ways.

Thanks.
Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] testsuite: gm2: Remove timeout overrides [PR114886]

2024-04-30 Thread Rainer Orth
A large number of gm2 tests are timing out even on current Solaris/SPARC
systems.  As detailed in the PR, the problem is that the gm2 testsuite
artificially lowers many timeouts way below the DejaGnu default of 300
seconds, often as short as 10 seconds.  The problem lies both in the
values (they may be appropriate for some targets, but too low for
others, especially under high load) and the fact that it uses absolute
values, overriding e.g. settings from a build-wide site.exp.

Therefore this patch removes all those overrides, restoring the
defaults.

Tested on sparc-sun-solaris2.11 (where all the previous timeouts are
gone) and i386-pc-solaris2.11.

Ok for trunk and the gcc-14 branch once GCC 14.1.0 has been released?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-29  Rainer Orth  

gcc/testsuite:
PR modula2/114886
* lib/gm2.exp: Don't load timeout-dg.exp.
Don't set gm2_previous_timeout.
Don't call dg-timeout.
(gm2_push_timeout, gm2_pop_timeout): Remove.
(gm2_init): Don't call dg-timeout.
* lib/gm2-torture.exp: Don't load timeout-dg.exp.
Don't set gm2_previous_timeout.
Don't call dg-timeout.
(gm2_push_timeout, gm2_pop_timeout): Remove.

* gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp: Don't
load timeout-dg.exp.
Don't call gm2_push_timeout, gm2_pop_timeout.
* gm2/examples/map/pass/examples-map-pass.exp: Don't call
gm2_push_timeout, gm2_pop_timeout.
* gm2/iso/run/pass/iso-run-pass.exp: Don't load timeout-dg.exp.
Don't call gm2_push_timeout, gm2_pop_timeout.
* gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp: Don't load
timeout-dg.exp.
Don't call gm2_push_timeout, gm2_pop_timeout.
* gm2/projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp:
Don't call gm2_push_timeout, gm2_pop_timeout.
* 
gm2/switches/whole-program/pass/run/switches-whole-program-pass-run.exp:
Don't load timeout-dg.exp.
Don't call gm2_push_timeout, gm2_pop_timeout.

# HG changeset patch
# Parent  7ce0689744625483e581866918724503e5630773
testsuite: gm2: Remove timeout overrides [PR114886]

diff --git a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
--- a/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
+++ b/gcc/testsuite/gm2/coroutines/pim/run/pass/coroutines-pim-run-pass.exp
@@ -24,16 +24,11 @@ if $tracelevel then {
 
 # load support procs
 load_lib gm2-torture.exp
-load_lib timeout-dg.exp
 
 set gm2src ${srcdir}/../gm2
 
 gm2_init_cor ""
 
-# We should be able to compile, link or run in 20 seconds.
-gm2_push_timeout 20
-
-
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
 # If we're only testing specific files and this isn't one of them, skip it.
 if ![runtest_file_p $runtests $testcase] then {
@@ -42,5 +37,3 @@ foreach testcase [lsort [glob -nocomplai
 
 gm2-torture-execute $testcase "" "pass"
 }
-
-gm2_pop_timeout
diff --git a/gcc/testsuite/gm2/examples/map/pass/examples-map-pass.exp b/gcc/testsuite/gm2/examples/map/pass/examples-map-pass.exp
--- a/gcc/testsuite/gm2/examples/map/pass/examples-map-pass.exp
+++ b/gcc/testsuite/gm2/examples/map/pass/examples-map-pass.exp
@@ -27,9 +27,6 @@ load_lib gm2-torture.exp
 
 gm2_init_pim "${srcdir}/${subdir}"
 
-# We should be able to compile, link or run in 30 seconds.
-gm2_push_timeout 30
-
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
 # If we're only testing specific files and this isn't one of them, skip it.
 if ![runtest_file_p $runtests $testcase] then {
@@ -38,5 +35,3 @@ foreach testcase [lsort [glob -nocomplai
 
 gm2-torture $testcase
 }
-
-gm2_pop_timeout
diff --git a/gcc/testsuite/gm2/iso/run/pass/iso-run-pass.exp b/gcc/testsuite/gm2/iso/run/pass/iso-run-pass.exp
--- a/gcc/testsuite/gm2/iso/run/pass/iso-run-pass.exp
+++ b/gcc/testsuite/gm2/iso/run/pass/iso-run-pass.exp
@@ -23,14 +23,10 @@ if $tracelevel then {
 
 # load support procs
 load_lib gm2-torture.exp
-load_lib timeout-dg.exp
 
 gm2_init_iso "${srcdir}/gm2/iso/run/pass" -fsoft-check-all
 gm2_link_obj fileio.o
 
-# We should be able to compile, link or run in 60 seconds.
-gm2_push_timeout 60
-
 foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] {
 # If we're only testing specific files and this isn't one of them, skip it.
 if ![runtest_file_p $runtests $testcase] then {
@@ -42,5 +38,3 @@ foreach testcase [lsort [glob -nocomplai
 	gm2-torture-execute $testcase "" "pass"
 }
 }
-
-gm2_pop_timeout
diff --git a/gcc/testsuite/gm2/pimlib/base/run/pass/pimlib-base-run-pass.exp b/gcc/testsuite/gm2/pimlib/base/run/pass/pimlib

[PATCH] libstdc++: Update Solaris baselines for GCC 14.0

2024-04-29 Thread Rainer Orth
This patch updates the Solaris baselines for the GLIBCXX_3.4.33 version
added in GCC 14.0.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit
each), together with the GLIBCXX_3.4.32 update, on both gcc-14 branch
and trunk.

Ok for and gcc-14 branch and trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-28  Rainer Orth  

libstdc++-v3:
* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
Likewise.

# HG changeset patch
# Parent  4232f168006d992630395835612adee6a8a72636
libstdc++: Update Solaris baselines for GCC 14.0

diff --git a/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt b/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
@@ -488,6 +488,7 @@ FUNC:_ZNKSt11__timepunctIwE7_M_daysEPPKw
 FUNC:_ZNKSt11__timepunctIwE8_M_am_pmEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.33
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
 FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
@@ -4487,6 +4488,7 @@ FUNC:__cxa_allocate_exception@@CXXABI_1.
 FUNC:__cxa_bad_cast@@CXXABI_1.3
 FUNC:__cxa_bad_typeid@@CXXABI_1.3
 FUNC:__cxa_begin_catch@@CXXABI_1.3
+FUNC:__cxa_call_terminate@@CXXABI_1.3.15
 FUNC:__cxa_call_unexpected@@CXXABI_1.3
 FUNC:__cxa_current_exception_type@@CXXABI_1.3
 FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
@@ -4530,6 +4532,7 @@ OBJECT:0:CXXABI_1.3.11
 OBJECT:0:CXXABI_1.3.12
 OBJECT:0:CXXABI_1.3.13
 OBJECT:0:CXXABI_1.3.14
+OBJECT:0:CXXABI_1.3.15
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
@@ -4567,6 +4570,7 @@ OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.30
 OBJECT:0:GLIBCXX_3.4.31
 OBJECT:0:GLIBCXX_3.4.32
+OBJECT:0:GLIBCXX_3.4.33
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
 OBJECT:0:GLIBCXX_3.4.6
diff --git a/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt b/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
@@ -488,6 +488,7 @@ FUNC:_ZNKSt11__timepunctIwE7_M_daysEPPKw
 FUNC:_ZNKSt11__timepunctIwE8_M_am_pmEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.33
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
 FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
 FUNC:_ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
@@ -4487,6 +4488,7 @@ FUNC:__cxa_allocate_exception@@CXXABI_1.
 FUNC:__cxa_bad_cast@@CXXABI_1.3
 FUNC:__cxa_bad_typeid@@CXXABI_1.3
 FUNC:__cxa_begin_catch@@CXXABI_1.3
+FUNC:__cxa_call_terminate@@CXXABI_1.3.15
 FUNC:__cxa_call_unexpected@@CXXABI_1.3
 FUNC:__cxa_current_exception_type@@CXXABI_1.3
 FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6
@@ -4530,6 +4532,7 @@ OBJECT:0:CXXABI_1.3.11
 OBJECT:0:CXXABI_1.3.12
 OBJECT:0:CXXABI_1.3.13
 OBJECT:0:CXXABI_1.3.14
+OBJECT:0:CXXABI_1.3.15
 OBJECT:0:CXXABI_1.3.2
 OBJECT:0:CXXABI_1.3.3
 OBJECT:0:CXXABI_1.3.4
@@ -4567,6 +4570,7 @@ OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.30
 OBJECT:0:GLIBCXX_3.4.31
 OBJECT:0:GLIBCXX_3.4.32
+OBJECT:0:GLIBCXX_3.4.33
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
 OBJECT:0:GLIBCXX_3.4.6
diff --git a/libstdc++-v3/config/abi/post/sparc-solaris/baseline_symbols.txt b/libstdc++-v3/config/abi/post/sparc-solaris/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/sparc-solaris/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/sparc-solaris/baseline_symbols.txt
@@ -488,6 +488,7 @@ FUNC:_ZNKSt11__timepunctIwE7_M_daysEPPKw
 FUNC:_ZNKSt11__timepunctIwE8_M_am_pmEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11__timepunctIwE9_M_monthsEPPKw@@GLIBCXX_3.4
 FUNC:_ZNKSt11logic_error4whatEv@@GLIBCXX_3.4
+FUNC:_ZNKSt12__basic_fileIcE13native_handleEv@@GLIBCXX_3.4.33
 FUNC:_ZNKSt12__basic_fileIcE7is_openEv@@GLIBCXX_3.4
 FUNC:_ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE2EEcvbEv@@GLIBCXX_3.4.31
 FUNC

[PATCH] libstdc++: Update Solaris baselines for GCC 13.2

2024-04-29 Thread Rainer Orth
This patch updates the Solaris baselines for the GLIBCXX_3.4.32 version
added in GCC 13.2.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit
each) on the gcc-13 branch and (together with the GLIBCXX_3.4.33 update)
on both gcc-14 branch and trunk.

Ok for all of gcc-13 and gcc-14 branches and trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-28  Rainer Orth  

libstdc++-v3:
* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
Likewise.

# HG changeset patch
# Parent  dd18a74d3c5f8539cec05a9394d14e209474ab64
libstdc++: Update Solaris baselines for GCC 13.2

diff --git a/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt b/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/i386-solaris/amd64/baseline_symbols.txt
@@ -3175,6 +3175,7 @@ FUNC:_ZNSt7__cxx1112basic_stringIcSt11ch
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_S_compareEmm@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_capacityEm@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_S_allocateERS3_m@@GLIBCXX_3.4.32
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_@@GLIBCXX_3.4.23
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcRKS3_@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC2EPcOS3_@@GLIBCXX_3.4.23
@@ -3327,6 +3328,7 @@ FUNC:_ZNSt7__cxx1112basic_stringIwSt11ch
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_replaceEmmPKwm@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_S_compareEmm@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_M_capacityEm@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_S_allocateERS3_m@@GLIBCXX_3.4.32
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwOS3_@@GLIBCXX_3.4.23
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS3_@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC2EPwOS3_@@GLIBCXX_3.4.23
@@ -4564,6 +4566,7 @@ OBJECT:0:GLIBCXX_3.4.29
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.30
 OBJECT:0:GLIBCXX_3.4.31
+OBJECT:0:GLIBCXX_3.4.32
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
 OBJECT:0:GLIBCXX_3.4.6
diff --git a/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt b/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
--- a/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/i386-solaris/baseline_symbols.txt
@@ -3175,6 +3175,7 @@ FUNC:_ZNSt7__cxx1112basic_stringIcSt11ch
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEjjPKcj@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_S_compareEjj@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_capacityEj@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_S_allocateERS3_j@@GLIBCXX_3.4.32
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcOS3_@@GLIBCXX_3.4.23
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC1EPcRKS3_@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderC2EPcOS3_@@GLIBCXX_3.4.23
@@ -3327,6 +3328,7 @@ FUNC:_ZNSt7__cxx1112basic_stringIwSt11ch
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_M_replaceEjjPKwj@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE10_S_compareEjj@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_M_capacityEj@@GLIBCXX_3.4.21
+FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE11_S_allocateERS3_j@@GLIBCXX_3.4.32
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwOS3_@@GLIBCXX_3.4.23
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS3_@@GLIBCXX_3.4.21
 FUNC:_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderC2EPwOS3_@@GLIBCXX_3.4.23
@@ -4564,6 +4566,7 @@ OBJECT:0:GLIBCXX_3.4.29
 OBJECT:0:GLIBCXX_3.4.3
 OBJECT:0:GLIBCXX_3.4.30
 OBJECT:0:GLIBCXX_3.4.31
+OBJECT:0:GLIBCXX_3.4.32
 OBJECT:0:GLIBCXX_3.4.4
 OBJECT:0:GLIBCXX_3.4.5
 OBJECT:0:GLIBCXX_3.4.6
diff --git a/libstdc++-v3/config/abi/post/sparc-solaris/baseline_symbols.txt

[PATCH] libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi

2024-04-23 Thread Rainer Orth
I noticed that libbacktrace make check FAILs on Solaris with the native
ld already when building the tests:

libtool: link: /var/gcc/regression/master/11.4-gcc/build/./gcc/xgcc -B/var/gcc/r
egression/master/11.4-gcc/build/./gcc/ -B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/
vol/gcc/sparc-sun-solaris2.11/lib/ -isystem /vol/gcc/sparc-sun-solaris2.11/inclu
de -isystem /vol/gcc/sparc-sun-solaris2.11/sys-include -fchecking=1 -funwind-tab
les -frandom-seed=ctesta_alloc -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmi
ssing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -
Werror -g -g -O2 -Wl,--compress-debug-sections=zlib-gabi -o ctesta_alloc ctesta_
alloc-btest.o ctesta_alloc-testlib.o  ./.libs/libbacktrace_alloc.a
ld: fatal: unrecognized '--compress-debug-sections' cmp-type: zlib-gabi
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1379: ctesta_alloc] Error 1

Solaris ld only supports --compress-debug-sections=zlib, while GNU ld
allows zlib-gabi as an alias for zlib.  gold is the same, it seems,
while lld doesn't support zlib-gabi at all.

Therefore the patch uses zlib instead.

Tested on i386-pc-solaris2.11 with ld and gld and x86_64-pc-linux-gnu
with gld.

With this patch, libbacktrace make check PASSes on Solaris.
Unfortunately, this is quite easy to miss since the make check output
isn't in DejaGnu summary format, thus not picked up by make
mail-report.log.  I mean to adapt the libgo support to produce that
output format for libbacktrace to fix this.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-05  Rainer Orth  

libbacktrace:
* Makefile.am (ctestg_LDFLAGS): Use
-Wl,--compress-debug-sections=zlib instead of zlib-gabi.
(ctesta_LDFLAGS): Likewise.
* Makefile.in: Regenerate.

# HG changeset patch
# Parent  3f974c85f19c90c967e272a1ca6523b897cc175f
libbacktrace: Avoid GNU ld --compress-debug-sections=zlib-gabi

diff --git a/libbacktrace/Makefile.am b/libbacktrace/Makefile.am
--- a/libbacktrace/Makefile.am
+++ b/libbacktrace/Makefile.am
@@ -497,12 +497,12 @@ if HAVE_COMPRESSED_DEBUG
 
 ctestg_SOURCES = btest.c testlib.c
 ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
+ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 ctestg_LDADD = libbacktrace.la
 
 ctesta_SOURCES = btest.c testlib.c
 ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
+ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 ctesta_LDADD = libbacktrace.la
 
 BUILDTESTS += ctestg ctesta
diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in
--- a/libbacktrace/Makefile.in
+++ b/libbacktrace/Makefile.in
@@ -1177,11 +1177,11 @@ libbacktrace_testing_ldflags = -no-insta
 @HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_alloc_LDADD = libbacktrace_alloc.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib-gnu $(libbacktrace_testing_ldflags)
+@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_LDADD = libbacktrace.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
-@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi $(libbacktrace_testing_ldflags)
+@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib $(libbacktrace_testing_ldflags)
 @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDADD = libbacktrace.la
 @HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_SOURCES = btest.c testlib.c
 @HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)


Re: [PATCH] build: Check for cargo when building rust language

2024-04-23 Thread Rainer Orth
Hi Arthur,

> On 4/17/24 10:13, Rainer Orth wrote:
>> Andrew Pinski  writes:
>> 
>>> On Mon, Apr 8, 2024 at 9:39 AM  wrote:
>>>>
>>>> From: Pierre-Emmanuel Patry 
>>>>
>>>> Hello,
>>>>
>>>> The rust frontend requires cargo to build some of it's components,
>>>> it's presence was not checked during configuration.
>>>
>>> WHY did this go in right before the release of GCC 14?
>>> I don't get why this is considered temporary and it goes in right
>>> before a release.
>>> That seems broken to me.
>> two more questions about this:
>> Right now, the new cargo configure test disable rust on all of my
>> targets (Solaris, Linux, Darwin) which didn't have it installed.  Before
>> (as recent as last Friday), I could successfully build and test
>> crab1/rust on all of them without cargo in sight.  So I wonder if the
>> patch isn't premature.
>
> We already have components depending on Rust libraries in our development
> repository, so this patch is important to ensure errors are emitted early
> during the configure phase rather than later at build time. I don't think
> this is premature, considering that your targets would fail to build the
> Rust frontend next time we upstream commits, which should happen this week
> or early next week.

it would have been very helpful to state this up front: introducing a
dependency that's never used outside of a configure test right night is
still damn confusing.  An alternative might have been to commit this
patch shortly before it's actually used.

>> Besides, while there are packaged versions of cargo for Solaris 11.4 and
>> Linux, Darwin hasn't anything (not checked Homebrew or similar yet).
>> What's worse, rustup only supports macOS 10.12 and up, while I'm still
>> regularly testing 10.7 and 10.11.  I don't really feel like building
>> rust from source here (if it works at all).  This hasn't been an issue
>> for any other languages that require additional tools for bootstrapping
>> (like Ada or D): there are versions of GNAT around that still support
>> those old Darwin releases, and I could use the C++ version of GDC in GCC
>> 11.
>
> Sorry, I'm not too familiar with the Rust situation on macOS. I am reading
> that starting from Rust version 1.74, the minimum macOS version required is
> indeed 10.12, released in 2016 I believe?
>
> We currently depend on Rust version 1.72, so you should be able to install
> it on macOS 10.11. Maybe with rustup? You can try something like the
> following:
>
> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
> --default-toolchain=1.72.0;

I tried this with mixed success: while the part of the installation that
goes into $RUSTUP_HOME at least can run cargo --version on both 10.7
and 10.11, the other one (for $CARGO_HOME) dies with SIGILL on 10.7
trying the same.

However, when I ignore most of what's installed by rustup and point
$PATH at .../toolchains/1.72.0-x86_64-apple-darwin/bin, I can run the
cargo in there with --version even on 10.7.  For the moment, that's good
enough to get a trunk build/test with rust including working again, but
of course this doesn't prove that this will remain so once cargo is
actually used.

> which is the default installation method for Rustup, with version 1.72 of
> the language specified. I'm not able to test this, sorry, but I'm very
> interested in knowing if it works. I think you can also install Rust using
> Homebrew, but again I am not able to test this and apologize.

I'll go down this route (or try installing rust from source) only if
need be.

> The goal is to reduce that Rust version further soon anyway - we are going
> to target Rust version 1.49, released 3 years ago, as that is the version
> that gccrs aims to compile. This will bring us closer to compiling our
> dependencies with our own frontend.

Good.  At least knowing this it's easier to check what macOS versions
are supported by e.g. 1.49.

>> At the very least, the Rust situation needs to be documented clearly.
>
> I'd love to work on this - what sort of documentation do you have in mind?
> Do you mean something like the online GCC documentation or an in-tree file?
> Let me know what you'd like me to add and I'll be happy to do so.

I think this should go into gcc/doc/install.texi, as for all other
languages and targets.  This way you have all the necessary information
in one place, while some in-tree file is almost guaranteed to be
overlooked.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: Request for testing on non-Linux targets; remove special casing of /usr/lib and /lib from the driver

2024-04-17 Thread Rainer Orth
Hi Andrew,

>   The driver currently will remove "/lib" and "/usr/lib" from the library
> path that gets passed to the linker because it considers them as paths that
> the linker will already known to search. But this is not true for newer
> linkers, mold and lld for an example don't have a default search path.
> This patch removes the special casing to fix FreeBSD building where lld is
> used by default and also fix riscv-linux-gnu when used in combination with
> mold.
> I have tested it on x86_64-linux-gnu and it works there but since the code
> in the driver has been around since 1992, I request some folks to test it
> on AIX, Mac OS (Darwin) and solaris where the ld is not GNU bfd ld as I
> don't have access to those targets currently.

actually, you do: all of those are availble inside the cfarm.

I've also tested the patch on i386-pc-solaris2.11 and
sparc-sun-solaris2.11 with the native ld: no regressions in either case.

>From what I can see, the handling of -Y P,* in gcc/config/sol2.h
(LINK_ARCH{32,64}_SPEC_BASE) can go as well.  I'll test this, but this
is almost certainly GCC 15 material.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH] build: Check for cargo when building rust language

2024-04-17 Thread Rainer Orth
Andrew Pinski  writes:

> On Mon, Apr 8, 2024 at 9:39 AM  wrote:
>>
>> From: Pierre-Emmanuel Patry 
>>
>> Hello,
>>
>> The rust frontend requires cargo to build some of it's components,
>> it's presence was not checked during configuration.
>
> WHY did this go in right before the release of GCC 14?
> I don't get why this is considered temporary and it goes in right
> before a release.
> That seems broken to me.

two more questions about this:

Right now, the new cargo configure test disable rust on all of my
targets (Solaris, Linux, Darwin) which didn't have it installed.  Before
(as recent as last Friday), I could successfully build and test
crab1/rust on all of them without cargo in sight.  So I wonder if the
patch isn't premature.

Besides, while there are packaged versions of cargo for Solaris 11.4 and
Linux, Darwin hasn't anything (not checked Homebrew or similar yet).
What's worse, rustup only supports macOS 10.12 and up, while I'm still
regularly testing 10.7 and 10.11.  I don't really feel like building
rust from source here (if it works at all).  This hasn't been an issue
for any other languages that require additional tools for bootstrapping
(like Ada or D): there are versions of GNAT around that still support
those old Darwin releases, and I could use the C++ version of GDC in GCC
11.

At the very least, the Rust situation needs to be documented clearly.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH v10 1/2] Add condition coverage (MC/DC)

2024-04-15 Thread Rainer Orth
Hi Jørgen,

>> the new gcc.misc-tests/gcov-22.c test loops on SPARC (both Solaris and
>> Linux).  I've filed PR gcov-profile/114720 for this, but couldn't find
>> any bugzilla account of yours to Cc:
>>  Rainer
>> 
>
> Rainer,
>
> Could you please try this patch? I don't have a sparc nor non-glibc build
> (and getting a virtual one up will take a while). I suppose the problem is

given that the test also FAILs on Linux/sparc64, it's not a
glibc-vs-non-glibc issue.

FWIW, there are both Solaris/SPARC and Linux/sparc64 systems available
in the cfarm; no need to build one yourself.  But fully agreed, running
a full bootstrap to verify a single testcase is a bit much if it can be
done more easily ;-)

> that after longjmp the return address is to the call to setdest(), not
> jump() (like is assumed), which creates the loop. If so, just guarding the
> longjmp should be fine, the point of the test is to make sure that both
> branches can be taken and recorded when the cond is a setjmp. If it works I
> will document it and post the patch.

I've just tried the patch on both sparc-sun-solaris2.11 and
i386-pc-solaris2.11 and the test now PASSes on both.

Thanks.
Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] testsuite: i386: Restrict gcc.target/i386/fhardened-1.c etc. to Linux/GNU

2024-04-15 Thread Rainer Orth
The new gcc.target/i386/fhardened-1.c etc. tests FAIL on Solaris/x86 and
Darwin/x86:

FAIL: gcc.target/i386/fhardened-1.c (test for excess errors)
FAIL: gcc.target/i386/fhardened-2.c (test for excess errors)

Excess errors: 
cc1: warning: '-fhardened' not supported for this target

Support for -fhardened is restricted to HAVE_FHARDENED_SUPPORT in
toplev.cc (process_options) which again is only defined for linux*|gnu*
targets in gcc/configure.ac.

Accordingly, this patch restricts the tests to those two, as is already
done in gcc.target/i386/cf_check-6.c.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.  Committed to
trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-04-15  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/fhardened-1.c: Restrict to Linux/GNU.
* gcc.target/i386/fhardened-2.c: Likewise.

# HG changeset patch
# Parent  270ceb327b3c4010c7f88cc77b599ddb43896640
testsuite: i386: Restrict gcc.target/i386/fhardened-1.c etc. to Linux/GNU

diff --git a/gcc/testsuite/gcc.target/i386/fhardened-1.c b/gcc/testsuite/gcc.target/i386/fhardened-1.c
--- a/gcc/testsuite/gcc.target/i386/fhardened-1.c
+++ b/gcc/testsuite/gcc.target/i386/fhardened-1.c
@@ -1,4 +1,5 @@
 /* PR target/114606 */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
 /* { dg-options "-fhardened -O2 -fcf-protection=none" } */
 
 #ifdef __CET__
diff --git a/gcc/testsuite/gcc.target/i386/fhardened-2.c b/gcc/testsuite/gcc.target/i386/fhardened-2.c
--- a/gcc/testsuite/gcc.target/i386/fhardened-2.c
+++ b/gcc/testsuite/gcc.target/i386/fhardened-2.c
@@ -1,4 +1,5 @@
 /* PR target/114606 */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
 /* { dg-options "-fhardened -O2" } */
 
 #if __CET__ != 3


Re: [PATCH 1/2] Remove unecessary and broken MC/DC compile test

2024-04-15 Thread Rainer Orth
Hi Jørgen,

> The __sigsetjmp test was added as a regression test, which an early
> iteration of the MC/DC support caused an internal compiler error,
> triggered by a code path which did not make it through to the final
> revision.  Since this test really only worked on linux and does not
> serve a purpose any more it can be removed.
>
> gcc/testsuite/ChangeLog:
>
>   * gcc.misc-tests/gcov-19.c: Remove test.

just a nit (and too late since it's already checked in): the ChangeLog
entry should specify *which test* was removed.  As is, it reads like the
whole file has been removed.  Something like

* gcc.misc-tests/gcov-19.c (__sigsetjmp, mcdc021c): Remove.

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH v10 1/2] Add condition coverage (MC/DC)

2024-04-15 Thread Rainer Orth
sc-tests/gcov-22.c: New test.
>>> * gcc.misc-tests/gcov-23.c: New test.
>>> ---
>>>   gcc/builtins.cc|2 +-
>>>   gcc/collect2.cc|7 +-
>>>   gcc/common.opt |9 +
>>>   gcc/doc/gcov.texi  |   38 +
>>>   gcc/doc/invoke.texi|   21 +
>>>   gcc/function.cc|1 +
>>>   gcc/function.h |4 +
>>>   gcc/gcc.cc |4 +-
>>>   gcc/gcov-counter.def   |3 +
>>>   gcc/gcov-dump.cc   |   24 +
>>>   gcc/gcov-io.h  |3 +
>>>   gcc/gcov.cc|  209 ++-
>>>   gcc/gimplify.cc|  123 +-
>>>   gcc/ipa-inline.cc  |2 +-
>>>   gcc/ipa-split.cc   |2 +-
>>>   gcc/passes.cc  |3 +-
>>>   gcc/profile.cc |   76 +-
>>>   gcc/testsuite/g++.dg/gcov/gcov-18.C|  282 
>>>   gcc/testsuite/gcc.misc-tests/gcov-19.c | 1737 
>>>   gcc/testsuite/gcc.misc-tests/gcov-20.c |   22 +
>>>   gcc/testsuite/gcc.misc-tests/gcov-21.c |   16 +
>>>   gcc/testsuite/gcc.misc-tests/gcov-22.c |  103 ++
>>>   gcc/testsuite/gcc.misc-tests/gcov-23.c |  361 +
>>>   gcc/testsuite/lib/gcov.exp |  259 +++-
>>>   gcc/tree-core.h|3 +
>>>   gcc/tree-profile.cc| 1058 ++-
>>>   gcc/tree.h |4 +
>>>   libgcc/libgcov-merge.c |5 +
>>>   28 files changed, 4339 insertions(+), 42 deletions(-)
>>>   create mode 100644 gcc/testsuite/g++.dg/gcov/gcov-18.C
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-19.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-20.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-21.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-22.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-23.c
>>>
>>> ---
>>> Changes since v9:
>>>
>>> * function->cond_uid is no longer in ggc memory
>>> * function->cond_uid and condition annotation is only done when coverage
>>>is requested
>>> * A few new test cases, notably interactions with C++ constexpr
>>> * Updated comments based on review feedback
>>> ---
>>>
>> 
>>> diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
>>> index dc120e6da5a..9502a21c741 100644
>>> --- a/gcc/ipa-inline.cc
>>> +++ b/gcc/ipa-inline.cc
>>> @@ -682,7 +682,7 @@ can_early_inline_edge_p (struct cgraph_edge *e)
>>>   }
>>> gcc_assert (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->decl))
>>>   && gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl)));
>>> -  if (profile_arc_flag
>>> +  if ((profile_arc_flag || condition_coverage_flag)
>>> && ((lookup_attribute ("no_profile_instrument_function",
>>> DECL_ATTRIBUTES (caller->decl)) == NULL_TREE)
>>>   != (lookup_attribute ("no_profile_instrument_function",
>> tree-inline should also copy the cond tags, since always_inline
>> functions are inlined even at -O0.  But I think this can be done
>> incrementally.
>> Patch is OK.
>> Thanks a lot and sorry for taking so long on this one.
>> Honza
>
> I guess you mean that since tree-inlining happen after gimplification (does
> it?) that the basic condition -> condition expression association should
> also fold in the now-inlined conditions?
>
> Thanks for the review - I'll do a final test run and install the patch.

the new gcc.misc-tests/gcov-22.c test loops on SPARC (both Solaris and
Linux).  I've filed PR gcov-profile/114720 for this, but couldn't find
any bugzilla account of yours to Cc:

Rainer


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH v10 1/2] Add condition coverage (MC/DC)

2024-04-05 Thread Rainer Orth
sc-tests/gcov-22.c: New test.
>>> * gcc.misc-tests/gcov-23.c: New test.
>>> ---
>>>   gcc/builtins.cc|2 +-
>>>   gcc/collect2.cc|7 +-
>>>   gcc/common.opt |9 +
>>>   gcc/doc/gcov.texi  |   38 +
>>>   gcc/doc/invoke.texi|   21 +
>>>   gcc/function.cc|1 +
>>>   gcc/function.h |4 +
>>>   gcc/gcc.cc |4 +-
>>>   gcc/gcov-counter.def   |3 +
>>>   gcc/gcov-dump.cc   |   24 +
>>>   gcc/gcov-io.h  |3 +
>>>   gcc/gcov.cc|  209 ++-
>>>   gcc/gimplify.cc|  123 +-
>>>   gcc/ipa-inline.cc  |2 +-
>>>   gcc/ipa-split.cc   |2 +-
>>>   gcc/passes.cc  |3 +-
>>>   gcc/profile.cc |   76 +-
>>>   gcc/testsuite/g++.dg/gcov/gcov-18.C|  282 
>>>   gcc/testsuite/gcc.misc-tests/gcov-19.c | 1737 
>>>   gcc/testsuite/gcc.misc-tests/gcov-20.c |   22 +
>>>   gcc/testsuite/gcc.misc-tests/gcov-21.c |   16 +
>>>   gcc/testsuite/gcc.misc-tests/gcov-22.c |  103 ++
>>>   gcc/testsuite/gcc.misc-tests/gcov-23.c |  361 +
>>>   gcc/testsuite/lib/gcov.exp |  259 +++-
>>>   gcc/tree-core.h|3 +
>>>   gcc/tree-profile.cc| 1058 ++-
>>>   gcc/tree.h |4 +
>>>   libgcc/libgcov-merge.c |5 +
>>>   28 files changed, 4339 insertions(+), 42 deletions(-)
>>>   create mode 100644 gcc/testsuite/g++.dg/gcov/gcov-18.C
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-19.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-20.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-21.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-22.c
>>>   create mode 100644 gcc/testsuite/gcc.misc-tests/gcov-23.c
>>>
>>> ---
>>> Changes since v9:
>>>
>>> * function->cond_uid is no longer in ggc memory
>>> * function->cond_uid and condition annotation is only done when coverage
>>>is requested
>>> * A few new test cases, notably interactions with C++ constexpr
>>> * Updated comments based on review feedback
>>> ---
>>>
>> 
>>> diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
>>> index dc120e6da5a..9502a21c741 100644
>>> --- a/gcc/ipa-inline.cc
>>> +++ b/gcc/ipa-inline.cc
>>> @@ -682,7 +682,7 @@ can_early_inline_edge_p (struct cgraph_edge *e)
>>>   }
>>> gcc_assert (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->decl))
>>>   && gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl)));
>>> -  if (profile_arc_flag
>>> +  if ((profile_arc_flag || condition_coverage_flag)
>>> && ((lookup_attribute ("no_profile_instrument_function",
>>> DECL_ATTRIBUTES (caller->decl)) == NULL_TREE)
>>>   != (lookup_attribute ("no_profile_instrument_function",
>> tree-inline should also copy the cond tags, since always_inline
>> functions are inlined even at -O0.  But I think this can be done
>> incrementally.
>> Patch is OK.
>> Thanks a lot and sorry for taking so long on this one.
>> Honza
>
> I guess you mean that since tree-inlining happen after gimplification (does
> it?) that the basic condition -> condition expression association should
> also fold in the now-inlined conditions?
>
> Thanks for the review - I'll do a final test run and install the patch.

this patch fails badly on Solaris (and probably all non-Linux targets):

+FAIL: gcc.misc-tests/gcov-19.c (test for excess errors)
+UNRESOLVED: gcc.misc-tests/gcov-19.c compilation failed to produce executable
+FAIL: gcc.misc-tests/gcov-19.c gcov: 0 failures in line counts, 0 in branch 
percentages, 796 in condition/decision, 0 in return percentages, 0 in 
intermediate format
+FAIL: gcc.misc-tests/gcov-19.c line 1006: unexpected summary - expected 1/24, 
got 0/24

and almost 1000 more lines.

gcov-19.exe doesn't link due to use of a Linux implementation detail:

Undefined   first referenced
 symbol in file
__sigsetjmp /var/tmp//cc.8e7Qc.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status

Either switch the testcase to use sigsetjmp or restrict it to Linux.
Besides, emitting many hundreds of FAILs if the testcase doesn't compile
is very bad style.

Please fix.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers

2024-03-22 Thread Rainer Orth
Hi Jakub,

> I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux:
> PASS: c-c++-common/gomp/depobj-3.c  -std=c++17  at line 17 (test for 
> warnings, line 15)
> FAIL: c-c++-common/gomp/depobj-3.c  -std=c++17  at line 39 (test for 
> warnings, line 37)
> PASS: c-c++-common/gomp/depobj-3.c  -std=c++17  at line 43 (test for errors, 
> line 41)
> PASS: c-c++-common/gomp/depobj-3.c  -std=c++17  (test for warnings, line 45)
> FAIL: c-c++-common/gomp/depobj-3.c  -std=c++17 (test for excess errors)
> Excess errors:
> /home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: 
> warning: the 'destroy' expression ''excess_precision_expr' not supported by 
> dump_expr' should be the same as the 'depobj' argument 
> 'obj' [-Wopenmp]
> The following patch replaces that 'excess_precision_expr' not supported by 
> dump_expr
> with (float)(((long double)a) + (long double)5)

this is PR c++/112724.

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH] testsuite: vect: Don't xfail scan-tree-dump in gcc.dg/vect/bb-slp-32.c [PR96147]

2024-03-22 Thread Rainer Orth
Hi Richard,

> On Thu, 21 Mar 2024, Rainer Orth wrote:
>
>> gcc.dg/vect/bb-slp-32.c currently XPASSes on 32 and 64-bit Solaris/SPARC:
>> 
>> XPASS: gcc.dg/vect/bb-slp-32.c -flto -ffat-lto-objects scan-tree-dump
>> slp2 "vectorization is not profitable"
>> XPASS: gcc.dg/vect/bb-slp-32.c scan-tree-dump slp2 "vectorization is not
>> profitable"
>> 
>> At least on SPARC, the current xfail can simply go, but I'm highly
>> uncertain if this is right in general.
>> 
>> Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.
>> 
>> Ok for trunk?
>
> The condition was made for the case where vectorization fails even when
> not considering costing.  But given we now do
>
>   p = __builtin_assume_aligned (p, __BIGGEST_ALIGNMENT__);
>
> that condition doesn't make sense anymore (forgot to update it in my
> r11-6715-gb36c9cd09472c8 change).
>
> In principle the testcase should be profitable to vectorize with
> the SLP reduction support now (and we'd vectorize it that way).
> But we fail to apply SLP node CSE when merging the SLP instance
> into a common subgraph, so we over-estimate cost (and perform
> double code generation that's later CSEd).
>
> That it's still not profitable on x86_64 for me is a quite narrow loss:
>
>   Vector cost: 144
>   Scalar cost: 140
>
> So ideally we'd key the FAIL on .REDUC_PLUS not being available for
> V4SImode but then we also try V2SImode where the reduction isn't
> recognized.  So the testcase wouldn't work well for targets comparing
> cost.
>
> I'd say we remove the dg-final completely for now.  I filed PR114413
> about the costing/CSE issue above.

Thanks.  This is what I committed after re-testing.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-03-19  Rainer Orth  

gcc/testsuite:
PR tree-optimization/96147
* gcc.dg/vect/bb-slp-32.c (dg-final): Remove.

# HG changeset patch
# Parent  b3b6fa4472bc1f2b170e2b736852ec93bae94480
testsuite: vect: Don't xfail scan-tree-dump in gcc.dg/vect/bb-slp-32.c [PR96147]

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
@@ -24,5 +24,3 @@ int foo (int *p, int a, int b)
   bar (x);
   return sum;
 }
-
-/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  { vect_no_align && { ! vect_hw_misalign } } } } } */


[PATCH] testsuite: vect: Don't xfail scan-tree-dump in gcc.dg/vect/bb-slp-32.c [PR96147]

2024-03-21 Thread Rainer Orth
gcc.dg/vect/bb-slp-32.c currently XPASSes on 32 and 64-bit Solaris/SPARC:

XPASS: gcc.dg/vect/bb-slp-32.c -flto -ffat-lto-objects  scan-tree-dump slp2 
"vectorization is not profitable"
XPASS: gcc.dg/vect/bb-slp-32.c scan-tree-dump slp2 "vectorization is not 
profitable"

At least on SPARC, the current xfail can simply go, but I'm highly
uncertain if this is right in general.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-03-19  Rainer Orth  

gcc/testsuite:
PR tree-optimization/96147
* gcc.dg/vect/bb-slp-32.c (scan-tree-dump): Remove xfail.

# HG changeset patch
# Parent  b3b6fa4472bc1f2b170e2b736852ec93bae94480
testsuite: vect: Don't xfail scan-tree-dump in gcc.dg/vect/bb-slp-32.c [PR96147]

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
@@ -25,4 +25,4 @@ int foo (int *p, int a, int b)
   return sum;
 }
 
-/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" { xfail  { vect_no_align && { ! vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp2" } } */


[PATCH] testsuite: i386: Skip gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c etc. with Solaris as [PR114150]

2024-03-21 Thread Rainer Orth
Two avx512cd tests FAIL to assemble with the Solaris/x86 assembler:

FAIL: gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c (test for excess errors)
UNRESOLVED: gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c compilation failed to 
produce executable
FAIL: gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c (test for excess errors)
UNRESOLVED: gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c compilation failed to 
produce executable

Excess errors: 
Assembler: avx512cd-vpbroadcastmb2q-2.c
"/var/tmp//ccs_9lod.s", line 42 : Invalid instruction argument
Near line: "vpbroadcastmb2q %k0, %zmm0"

Assembler: avx512cd-vpbroadcastmw2d-2.c
"/var/tmp//ccevT6Rd.s", line 35 : Invalid instruction argument
Near line: "vpbroadcastmw2d %k0, %zmm0"

This seems to be an as bug, but given that this rarely if ever gets any
fixes these days, this test just skips the affected tests.

Adjuststing check_effective_target_avx512cd instead doesn't seem
sensible since it would disable quite a number of working tests.

Tested on i386-pc-solaris2.11 (as and gas) and x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-03-19  Rainer Orth  

gcc/testsuite:
PR target/114150
* gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c: Skip on
Solaris/x86 with as.
* gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c: Likewise.

# HG changeset patch
# Parent  23c541e5d902f9a56abba0367e1fb8326f350d16
testsuite: i386: xfail gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c etc. with Solaris as [PR114150]

diff --git a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
--- a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmb2q-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -mavx512cd" } */
 /* { dg-require-effective-target avx512cd } */
+/* { dg-skip-if "PR target/114150" { *-*-solaris2.* && { ! gas } } } */
 
 #define HAVE_512
 #define AVX512CD
diff --git a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
--- a/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx512cd-vpbroadcastmw2d-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -mavx512cd" } */
 /* { dg-require-effective-target avx512cd } */
+/* { dg-skip-if "PR target/114150" { *-*-solaris2.* && { ! gas } } } */
 
 #define HAVE_512
 #define AVX512CD


[PATCH] testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/vect-cost-model-1.c etc. [PR98238]

2024-03-11 Thread Rainer Orth
Several gcc.dg/vect/vect-cost-model-?.c tests FAIL on 32 and 64-bit
Solaris/SPARC:

FAIL: gcc.dg/vect/vect-cost-model-1.c -flto -ffat-lto-objects  scan-tree-dump 
vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-cost-model-1.c scan-tree-dump vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-cost-model-3.c -flto -ffat-lto-objects  scan-tree-dump 
vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-cost-model-3.c scan-tree-dump vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-cost-model-5.c -flto -ffat-lto-objects  scan-tree-dump 
vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-cost-model-5.c scan-tree-dump vect "LOOP VECTORIZED"

The dumps show

/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:7:30:
 note:   ==> examining statement: _3 = *_2;
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:7:30:
 missed:   unsupported unaligned access
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c:8:6: 
missed:   not vectorized: relevant stmt not supported: _3 = *_2;

so I think the tests need to require vect_hw_misalign.  This is what
this patch does.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

Ok for trunk?

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-22  Rainer Orth  

gcc/testsuite:
PR tree-optimization/98238
* gcc.dg/vect/vect-cost-model-1.c (scan-tree-dump): Also require
vect_hw_misalign.
* gcc.dg/vect/vect-cost-model-3.c: Likewise.
* gcc.dg/vect/vect-cost-model-5.c: Likewise.

# HG changeset patch
# Parent  7238442252360e699145461779d03baf86bc3a7a
testsuite: vect: Require vect_hw_misalign in gcc.dg/vect/vect-cost-model-1.c etc. [PR98238]

diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c
--- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-1.c
@@ -8,4 +8,4 @@ f (int *x, int *y)
 x[i] += y[i];
 }
 
-/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */
+/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c
--- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-3.c
@@ -8,4 +8,4 @@ f (int *restrict x, int *restrict y)
 x[i] += y[i];
 }
 
-/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */
+/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c b/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c
--- a/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cost-model-5.c
@@ -8,4 +8,4 @@ f (int *restrict x, int *restrict y)
 x[i] += y[i];
 }
 
-/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target vect_int } } } */
+/* { dg-final { scan-tree-dump {LOOP VECTORIZED} vect { target { vect_int && vect_hw_misalign } } } } */


[PATCH] testsuite: vect: Require vect_perm in several tests [PR114071, PR113557, PR96109]

2024-03-11 Thread Rainer Orth
Several vectorization tests FAIL on 32 and 64-bit Solaris/SPARC:

FAIL: gcc.dg/vect/pr37027.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorized 1 loops" 1
FAIL: gcc.dg/vect/pr37027.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/pr37027.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/pr37027.c scan-tree-dump-times vect "vectorizing stmts using 
SLP" 1
FAIL: gcc.dg/vect/pr67790.c -flto -ffat-lto-objects  scan-tree-dump vect 
"vectorizing stmts using SLP"
FAIL: gcc.dg/vect/pr67790.c scan-tree-dump vect "vectorizing stmts using SLP"
FAIL: gcc.dg/vect/slp-47.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorizing stmts using SLP" 2
FAIL: gcc.dg/vect/slp-47.c scan-tree-dump-times vect "vectorizing stmts using 
SLP" 2
FAIL: gcc.dg/vect/slp-48.c -flto -ffat-lto-objects  scan-tree-dump-times vect 
"vectorizing stmts using SLP" 2
FAIL: gcc.dg/vect/slp-48.c scan-tree-dump-times vect "vectorizing stmts using 
SLP" 2
FAIL: gcc.dg/vect/slp-reduc-1.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-1.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-1.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-1.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-2.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-2.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-2.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-2.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-7.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/slp-reduc-7.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
FAIL: gcc.dg/vect/slp-reduc-8.c -flto -ffat-lto-objects  scan-tree-dump vect 
"vectorized 1 loops"
FAIL: gcc.dg/vect/slp-reduc-8.c scan-tree-dump vect "vectorized 1 loops"
FAIL: gcc.dg/vect/vect-multi-peel-gaps.c -flto -ffat-lto-objects  
scan-tree-dump vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-multi-peel-gaps.c scan-tree-dump vect "LOOP VECTORIZED"

The dumps show variations of

/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: note:   
==> examining statement: _4 = a[i_19].f2;
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: missed: 
  unsupported vect permute { 1 0 3 2 5 4 }
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:24:17: missed: 
  unsupported load permutation
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/vect/pr37027.c:27:17: missed: 
  not vectorized: relevant stmt not supported: _4 = a[i_19].f2;

so I think the tests should require vect_perm.  This is what this patch does

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-22  Rainer Orth  

gcc/testsuite:
PR tree-optimization/114071
* gcc.dg/vect/pr37027.c: Require vect_perm.
* gcc.dg/vect/pr67790.c: Likewise.
* gcc.dg/vect/slp-reduc-1.c: Likewise.
* gcc.dg/vect/slp-reduc-2.c: Likewise.
* gcc.dg/vect/slp-reduc-7.c: Likewise.
* gcc.dg/vect/slp-reduc-8.c: Likewise.

PR tree-optimization/113557
* gcc.dg/vect/vect-multi-peel-gaps.c (scan-tree-dump): Also
require vect_perm.

PR testsuite/96109
* gcc.dg/vect/slp-47.c: Require vect_perm.
* gcc.dg/vect/slp-48.c: Likewise.

# HG changeset patch
# Parent  7af365ac71939e435bbc93927bcfa439568af4e5
testsuite: vect: Require vect_perm in several tests [PR??]

diff --git a/gcc/testsuite/gcc.dg/vect/pr37027.c b/gcc/testsuite/gcc.dg/vect/pr37027.c
--- a/gcc/testsuite/gcc.dg/vect/pr37027.c
+++ b/gcc/testsuite/gcc.dg/vect/pr37027.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_perm } */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.dg/vect/pr67790.c b/gcc/testsuite/gcc.dg/vect/pr67790.c
--- a/gcc/testsuite/gcc.dg/vect/pr67790.c
+++ b/gcc/testsuite/gcc.dg/vect/pr67790.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* {

Re: [PATCH] combine: Don't simplify paradoxical SUBREG on WORD_REGISTER_OPERATIONS [PR113010]

2024-03-04 Thread Rainer Orth
Hi Jeff,

> On 2/26/24 17:17, Greg McGary wrote:
>> The sign-bit-copies of a sign-extending load cannot be known until runtime on
>> WORD_REGISTER_OPERATIONS targets, except in the case of a zero-extending MEM
>> load.  See the fix for PR112758.
>> 2024-02-22  Greg McGary  
>>  PR rtl-optimization/113010
>>  * combine.cc (simplify_comparison): Simplify a SUBREG on
>>WORD_REGISTER_OPERATIONS targets only if it is a zero-extending
>>MEM load.
>>  * gcc.c-torture/execute/pr113010.c: New test.
> I think this is fine for the trunk.  I'll do some final testing on it
> tomorrow.

unfortunately, the patch broke Solaris/SPARC bootstrap
(sparc-sun-solaris2.11):

/vol/gcc/src/hg/master/local/gcc/combine.cc: In function 'rtx_code 
simplify_comparison(rtx_code, rtx_def**, rtx_def**)':
/vol/gcc/src/hg/master/local/gcc/combine.cc:12101:25: error: '*(unsigned 
int*)((char*)_mode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))' 
may be used uninitialized [-Werror=maybe-uninitialized]
12101 |   scalar_int_mode mode, inner_mode, tmode;
  | ^~

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] testsuite: Fix gcc.dg/tree-ssa/builtin-snprintf-6.c XPASS on i?86 -m64 [PR91567]

2024-02-28 Thread Rainer Orth
gcc.dg/tree-ssa/builtin-snprintf-6.c currently XPASSes on i?86-*-*
configurations with -m64:

XPASS: gcc.dg/tree-ssa/builtin-snprintf-6.c scan-tree-dump-times optimized 
"Function test_assign_aggregate" 1

(seen e.g. on i386-pc-solaris2.11, i686-pc-linux-gnu, or i386-apple-darwin*).

The problem is that the xfail only handles x86_64, ignoring that i?86
configurations can also be multilibbed.

This patch fixes the by handling both forms alike.

Tested on i386-pc-solaris2.11, amd64-pc-solaris2.11,
sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-28  Rainer Orth  

gcc/testsuite:
PR tree-optimization/91567
* gcc.dg/tree-ssa/builtin-snprintf-6.c (scan-tree-dump-times):
Treat i?86-*-* like x86_64-*-*.

# HG changeset patch
# Parent  27664b7bca147c0d4b3e5aa0e758719dbfc543aa
testsuite: Fix gcc.dg/tree-ssa/builtin-snprintf-6.c XPASS on i?86 -m64

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c
--- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-6.c
@@ -91,7 +91,7 @@ void test_assign_aggregate (void)
   T (5, "123456", "s=%.*s", 3, [2]);
 }
 
-/* { dg-final { scan-tree-dump-times "Function test_assign_aggregate" 1 "optimized" { xfail { { ! x86_64-*-* } || { ilp32 } } } } } */
+/* { dg-final { scan-tree-dump-times "Function test_assign_aggregate" 1 "optimized" { xfail { { ! { i?86-*-* x86_64-*-* } } || { ilp32 } } } } } */
 
 #endif   /* x86_64 */
 


[COMMITTED] testsuite: Fix gcc.dg/attr-weakref-1.c on Solaris/x86 with as [PR70582]

2024-02-26 Thread Rainer Orth
gcc.dg/attr-weakref-1.c FAILs on 32 and 64-bit Solaris/x86 with the
native assembler:

FAIL: gcc.dg/attr-weakref-1.c (test for excess errors)
UNRESOLVED: gcc.dg/attr-weakref-1.c compilation failed to produce executable

Excess errors:
Assembler: attr-weakref-1.c
"/var/tmp//ccUSaysF.s", line 171 : Multiply defined symbol: "Wv3a"

This is a bug in the native as, which isn't seeing fixes recently.

Since only a single subtest is affected, this patch omits that one.

Tested on i386-pc-solaris2.11 (as and gas) and x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-24  Rainer Orth  

gcc/testsuite:
PR ipa/70582
* gcc.dg/attr-weakref-1.c (dg-additional-options): Define
SOLARIS_X86_AS as appropriate.
(lv3, Wv3a, pv3a): Wrap in !SOLARIS_X86_AS.
(main): Likewise for chk (pv3a).

# HG changeset patch
# Parent  c2e97b9d632bb04de7c4c87d39b7e813f640f9f9
testsuite: Fix gcc.dg/attr-weakref-1.c on Solaris/x86 with as [PR70582]

diff --git a/gcc/testsuite/gcc.dg/attr-weakref-1.c b/gcc/testsuite/gcc.dg/attr-weakref-1.c
--- a/gcc/testsuite/gcc.dg/attr-weakref-1.c
+++ b/gcc/testsuite/gcc.dg/attr-weakref-1.c
@@ -14,6 +14,8 @@
 // { dg-options "-O2" }
 // { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
 // { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } }
+// One subtest doesn't assemble with the Solaris/x86 as (PR ipa/70582)
+// { dg-additional-options "-DSOLARIS_X86_AS" { target { *86*-*-solaris2* && { ! gas } } } }
 // { dg-additional-sources "attr-weakref-1a.c" }
 
 // Copyright 2005 Free Software Foundation, Inc.
@@ -46,9 +48,11 @@ vtype gv2;
 static vtype Wv2a __attribute__((weakref ("gv2")));
 static vtype *pv2a USED = 
 
+#if !defined SOLARIS_X86_AS
 static vtype lv3;
 static vtype Wv3a __attribute__((weakref ("lv3")));
 static vtype *pv3a USED = 
+#endif
 
 extern vtype uv4;
 static vtype Wv4a __attribute__((weakref ("uv4")));
@@ -192,7 +196,9 @@ extern ftype wf14 __attribute__((weak));
 int main () {
   chk (!pv1a);
   chk (pv2a);
+#if !defined(SOLARIS_X86_AS)
   chk (pv3a);
+#endif
   chk (pv4a);
   chk (pv4);
   chk (pv5a);


[COMMITTED] testsuite: xfail gcc.c-torture/compile/pr61159.c on Solaris/x86 with as [PR61159]

2024-02-26 Thread Rainer Orth
gcc.c-torture/compile/pr61159.c currently FAILs on 32 and 64-bit
Solaris/x86 with the native assembler:

FAIL: gcc.c-torture/compile/pr61159.c   -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2 -flto  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O2 -flto -flto-partition=none  (test 
for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr61159.c   -Os  (test for excess errors)

Excess errors:
Assembler: pr61159.c
"/var/tmp//ccRtFPva.s", line 5 : Cannot set a weak symbol to a common 
symbol

This is a bug/limitation in the native assembler.  Given that this
hasn't seen fixes for a long time, this patch xfails the test.

Tested on i386-pc-solaris2.11 (as and gas) and x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-24  Rainer Orth  

gcc/testsuite:
PR ipa/61159
* gcc.c-torture/compile/pr61159.c: xfail on Solaris/x86 with as.

# HG changeset patch
# Parent  32a7094d0d8c1c287ab2dce6f79e2ad1530d1113
testsuite: xfail gcc.c-torture/compile/pr61159.c on Solaris/x86 with as [PR61159]

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr61159.c b/gcc/testsuite/gcc.c-torture/compile/pr61159.c
--- a/gcc/testsuite/gcc.c-torture/compile/pr61159.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr61159.c
@@ -1,6 +1,6 @@
 /* { dg-require-alias "" } */
 /* { dg-require-weak "" } */
-/* { dg-xfail-if "weak alias" { powerpc-ibm-aix* } } */
+/* { dg-xfail-if "weak alias" { powerpc-ibm-aix* || { *86*-*-solaris* && { ! gas } } } } */
 
 static int dummy = 0;
 extern int foo __attribute__((__weak__, __alias__("dummy")));


[COMMITTED] testsuite: vect: Actually skip gcc.dg/vect/vect-bic-bitmask-12.c etc. on SPARC

2024-02-23 Thread Rainer Orth
gcc.dg/vect/vect-bic-bitmask-12.c and gcc.dg/vect/vect-bic-bitmask-23.c
currently FAIL on 32 and 64-bit Solaris/SPARC

FAIL: gcc.dg/vect/vect-bic-bitmask-12.c -flto -ffat-lto-objects  scan-tree-dump 
dce7 "<=s*.+{ 255,.+}"
FAIL: gcc.dg/vect/vect-bic-bitmask-12.c scan-tree-dump dce7 "<=s*.+{ 
255,.+}"
FAIL: gcc.dg/vect/vect-bic-bitmask-23.c -flto -ffat-lto-objects  scan-tree-dump 
dce7 "<=s*.+{ 255, 15, 1, 65535 }"
FAIL: gcc.dg/vect/vect-bic-bitmask-23.c scan-tree-dump dce7 "<=s*.+{ 255, 
15, 1, 65535 }"

although they should be skipped since

commit 5f07095d22f58572c06997aa6d4f3bc456e1925d
Author: Tamar Christina 
Date:   Tue Mar 8 11:32:59 2022 +

vect: disable bitmask tests on sparc

The problem is that dg-skip-if must come after dg-do, although this
isn't currently documented unfortunately.

Fixed by reordering the directives.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-22  Rainer Orth  

gcc/testsuite:
* gcc.dg/vect/vect-bic-bitmask-12.c: Move dg-skip-if down.
* gcc.dg/vect/vect-bic-bitmask-23.c: Likewise.

# HG changeset patch
# Parent  9c588428a6e298fa35c5bf75d7d374105b1575bd
testsuite: vect: Actually skip  gcc.dg/vect/vect-bic-bitmask-12.c etc. on SPARC

diff --git a/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-12.c b/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-12.c
--- a/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-12.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-12.c
@@ -1,6 +1,6 @@
-/* { dg-skip-if "missing optab for vectorization" { sparc*-*-* } } */
 /* { dg-do compile } */
 /* { dg-additional-options "-O3 -fdump-tree-dce -w" } */
+/* { dg-skip-if "missing optab for vectorization" { sparc*-*-* } } */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-23.c b/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-23.c
--- a/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-23.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-bic-bitmask-23.c
@@ -1,6 +1,6 @@
-/* { dg-skip-if "missing optab for vectorization" { sparc*-*-* } } */
 /* { dg-do compile } */
 /* { dg-additional-options "-O1 -fdump-tree-dce -w" } */
+/* { dg-skip-if "missing optab for vectorization" { sparc*-*-* } } */
 
 #include 
 


[COMMITTED] testsuite: plugin: Fix gcc.dg/plugin/crash-test-write-though-null-sarif.c on Solaris

2024-02-23 Thread Rainer Orth
gcc.dg/plugin/crash-test-write-though-null-sarif.c FAILs on Solaris:

FAIL: gcc.dg/plugin/crash-test-write-though-null-sarif.c 
-fplugin=./crash_test_plugin.so  scan-sarif-file "text": "Segmentation fault

Comparing the sarif files between Linux and Solaris reveals

-"message": 
{"text": "Segmentation fault"},
+"message": 
{"text": "Segmentation Fault"},

This patch allows for both forms.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-22  Rainer Orth  

gcc/testsuite:
* gcc.dg/plugin/crash-test-write-though-null-sarif.c
(scan-sarif-file): Allow for "Segmentation Fault", too.

# HG changeset patch
# Parent  ed942d3ea6c0b97b1812ed2c6563fd5873c8edca
testsuite: plugin: Fix gcc.dg/plugin/crash-test-write-though-null-sarif.c on Solaris

diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-write-though-null-sarif.c b/gcc/testsuite/gcc.dg/plugin/crash-test-write-though-null-sarif.c
--- a/gcc/testsuite/gcc.dg/plugin/crash-test-write-though-null-sarif.c
+++ b/gcc/testsuite/gcc.dg/plugin/crash-test-write-though-null-sarif.c
@@ -61,4 +61,4 @@ void test_inject_write_through_null (voi
{ dg-final { scan-sarif-file "\"startColumn\": 3" } }
{ dg-final { scan-sarif-file "\"endColumn\": 31" } }
  { dg-final { scan-sarif-file "\"message\": " } }
-   { dg-final { scan-sarif-file "\"text\": \"Segmentation fault" } } */
+   { dg-final { scan-sarif-file "\"text\": \"Segmentation \[Ff\]ault" } } */


Re: [patch] fix libsanitizer build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 on 32bit architectures

2024-02-22 Thread Rainer Orth
Hi Matthias,

> libsanitizer fails to build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64,
> triggering an #error in /usr/include/features-time64.h
>
> --- a/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
> +++ b/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp
> @@ -11,6 +11,7 @@
>
>  // Before Solaris 11.4,  doesn't work in a largefile
>  environment.
>  #undef _FILE_OFFSET_BITS
> +#undef _TIME_BITS
>  #include "sanitizer_platform.h"
>  #if SANITIZER_SOLARIS
>  #  include 
> --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
> +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
> @@ -18,6 +18,7 @@
>  // depends on _FILE_OFFSET_BITS setting.
>  // To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS
>  below.
>  #undef _FILE_OFFSET_BITS
> +#undef _TIME_BITS
>  #endif
>
>  // Must go after undef _FILE_OFFSET_BITS.
>
>
> The patch to sanitizer_platform_limits_posix.cpp is already present in
> trunk, but missing from the branches.
>
> Because all platform files are built in GCC, you also see the failure in
> sanitizer_procmaps_solaris.cpp. Just doing the same as for the posix 
> files fixes the issue and libsanitizer builds again.
>
> Does this have any effect on the solaris builds?  If not, ok for the trunk
> and the branches?

Since _TIME_BITS isn't used in Solaris system headers at all, there's no
impact.

However, the sanitizer_procmaps_solaris.cpp change needs to go into
upstream LLVM first and can only then be cherry-picked into libsanitizer
once it has been committed there.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH] libsanitizer: Intercept __makecontext_v2 on Solaris/SPARC [PR113785]

2024-02-16 Thread Rainer Orth
Hi Jakub,

> On Fri, Feb 16, 2024 at 01:32:04PM +0100, Rainer Orth wrote:
>> c-c++-common/asan/swapcontext-test-1.c FAILs on Solaris/SPARC:
>> 
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -O0  execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -O1  execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2  execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2 -flto  execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c -O2 -flto
>> -flto-partition=none execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c -O3 -fomit-frame-pointer
>> -funroll-loops -fpeel-loops -ftracer -finline-functions execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -O3 -g  execution test
>> FAIL: c-c++-common/asan/swapcontext-test-1.c   -Os  execution test
>> 
>> As detailed in PR sanitizer/113785, this happens because an ABI change
>> in Solaris 10/SPARC caused the external symbol for makecontext to be
>> changed to __makecontext_v2, which isn't intercepted.
>
> Is Solaris 9/SPARC and earlier no longer supported in GCC?

no, Solaris 9 support was removed in GCC 5 already.  The only version
supported by trunk is 11.4; 11.3 isn't but I won't actually remove
support until Solaris 11.4 systems have been added to the cfarm (which
should be soon).

> If so, ok for trunk.

Thanks.

> Otherwise I'd expect some ifdefs or whatever to check if it is
> Solaris 10+ with __makecontext_v2 or Solaris up to 9 with makecontext.

True.  However, it can be difficult to get patches upstream for OS
versions not remotely supported in LLVM (which has been 11.4-only for
years).

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] libsanitizer: Intercept __makecontext_v2 on Solaris/SPARC [PR113785]

2024-02-16 Thread Rainer Orth
c-c++-common/asan/swapcontext-test-1.c FAILs on Solaris/SPARC:

FAIL: c-c++-common/asan/swapcontext-test-1.c   -O0  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O1  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2 -flto  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O2 -flto -flto-partition=none  
execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -O3 -g  execution test
FAIL: c-c++-common/asan/swapcontext-test-1.c   -Os  execution test

As detailed in PR sanitizer/113785, this happens because an ABI change
in Solaris 10/SPARC caused the external symbol for makecontext to be
changed to __makecontext_v2, which isn't intercepted.

The following patch, submitted upstream at
https://github.com/llvm/llvm-project/pull/81588, fixes that.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11.

Ok to cherry-pick into trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-16  Rainer Orth  

libsanitizer:
PR sanitizer/113785
* sanitizer_common/asan/asan_interceptors.cpp: Cherry-pick
llvm-project revision 8c2033719a843a1880427a5e8caa5563248bce78.

# HG changeset patch
# Parent  2fb800df7e0fd2d03a485601ad4683a29f78f2a4
libsanitizer: Intercept __makecontext_v2 on Solaris/SPARC [PR113785]

diff --git a/libsanitizer/asan/asan_interceptors.cpp b/libsanitizer/asan/asan_interceptors.cpp
--- a/libsanitizer/asan/asan_interceptors.cpp
+++ b/libsanitizer/asan/asan_interceptors.cpp
@@ -347,8 +347,16 @@ static void ClearShadowMemoryForContextS
   PoisonShadow(bottom, ssize, 0);
 }
 
+// Since Solaris 10/SPARC, ucp->uc_stack.ss_sp refers to the stack base address
+// as on other targets.  For binary compatibility, the new version uses a
+// different external name, so we intercept that.
+#if SANITIZER_SOLARIS && defined(__sparc__)
+INTERCEPTOR(void, __makecontext_v2, struct ucontext_t *ucp, void (*func)(),
+int argc, ...) {
+#else
 INTERCEPTOR(void, makecontext, struct ucontext_t *ucp, void (*func)(), int argc,
 ...) {
+#endif
   va_list ap;
   uptr args[64];
   // We don't know a better way to forward ... into REAL function. We can
@@ -368,7 +376,11 @@ INTERCEPTOR(void, makecontext, struct uc
   ENUMERATE_ARRAY_16(0), ENUMERATE_ARRAY_16(16), ENUMERATE_ARRAY_16(32), \
   ENUMERATE_ARRAY_16(48)
 
+#if SANITIZER_SOLARIS && defined(__sparc__)
+  REAL(__makecontext_v2)
+#else
   REAL(makecontext)
+#endif
   ((struct ucontext_t *)ucp, func, argc, ENUMERATE_ARRAY_64());
 
 #undef ENUMERATE_ARRAY_4
@@ -783,7 +795,12 @@ void InitializeAsanInterceptors() {
 
 #  if ASAN_INTERCEPT_SWAPCONTEXT
   ASAN_INTERCEPT_FUNC(swapcontext);
+  // See the makecontext interceptor above for an explanation.
+#if SANITIZER_SOLARIS && defined(__sparc__)
+  ASAN_INTERCEPT_FUNC(__makecontext_v2);
+#else
   ASAN_INTERCEPT_FUNC(makecontext);
+#endif
 #  endif
 #  if ASAN_INTERCEPT__LONGJMP
   ASAN_INTERCEPT_FUNC(_longjmp);


[COMMITTED] testsuite: Require lto-plugin support in gcc.dg/lto/modref-3 etc. [PR98237]

2024-02-16 Thread Rainer Orth
gcc.dg/lto/modref-3 etc. FAIL on Solaris with the native linker:

FAIL: gcc-dg-lto-modref-3-01.exe scan-wpa-ipa-dump modref "parm 1 flags: 
no_direct_clobber no_direct_escape"
FAIL: gcc-dg-lto-modref-4-01.exe scan-wpa-ipa-dump modref "parm 1 flags: 
no_direct_clobber no_direct_escape"
FAIL: gcc.dg/lto/modref-3 c_lto_modref-3_0.o-c_lto_modref-3_1.o execute -O2 
-flto-partition=max -fdump-ipa-modref -fno-ipa-sra -fno-ipa-cp -flto
FAIL: gcc.dg/lto/modref-4 c_lto_modref-4_0.o-c_lto_modref-4_1.o execute -O2 
-flto-partition=max -fdump-ipa-modref -fno-ipa-sra -flto

The issue is that the tests require the linker plugin, which isn't
available with Solaris ld.  Thus, it also FAILs when gcc is configured
with --disable-lto-plugin.

This patch thus declares the requirement.  As it turns out, there's an
undocumented dg-require-linker-plugin already, but I introduce and use
the corresponding effective-target keyword and document both.

Given that the effective-target form is more flexible, I'm tempted to
remove dg-require-* with an empty arg as already mentioned in
sourcebuild.texi.  That is not this patch, however.

Tested on i386-pc-solaris2.11 with ld and gld.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-14  Rainer Orth  

gcc/testsuite:
PR ipa/98237
* lib/target-supports.exp (is-effective-target): Handle
linker_plugin.
* gcc.dg/lto/modref-3_0.c: Require linker_plugin support.
* gcc.dg/lto/modref-4_0.c: Likewise.

gcc:
* doc/sourcebuild.texi (Effective-Target Keywords, Other
attribugs): Document linker_plugin.
(Require Support): Document dg-require-linker-plugin.

# HG changeset patch
# Parent  c4cd589ec9c0ac709c6678e47799d87d82fbad00
testsuite: Require lto-plugin support in gcc.dg/lto/modref-3 etc. [PR98237]

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -3009,6 +3009,9 @@ Target supports @option{-mpe-aligned-com
 @item pie
 Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}.
 
+@item linker_plugin
+Target supports the linker plugin.
+
 @item rdynamic
 Target supports @option{-rdynamic}.
 
@@ -3337,6 +3340,10 @@ system.  Some tests are incompatible wit
 hosts, which involves copying the source file to the host and compiling
 it with a relative path and "@code{-o a.out}".
 
+@item dg-require-linker-plugin ""
+Skip the test is the target does not support the linker plugin.
+This is equivalent to @code{dg-require-effective-target linker_plugin}.
+
 @item dg-require-mkfifo ""
 Skip the test if the target does not support @code{mkfifo}.
 
diff --git a/gcc/testsuite/gcc.dg/lto/modref-3_0.c b/gcc/testsuite/gcc.dg/lto/modref-3_0.c
--- a/gcc/testsuite/gcc.dg/lto/modref-3_0.c
+++ b/gcc/testsuite/gcc.dg/lto/modref-3_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do run } */
 /* { dg-lto-options { {-O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -fno-ipa-cp -flto} } } */
+/* { dg-require-effective-target linker_plugin } */
 extern void copy (int *a, int *b);
 extern void barrier ();
 extern int *ptr;
diff --git a/gcc/testsuite/gcc.dg/lto/modref-4_0.c b/gcc/testsuite/gcc.dg/lto/modref-4_0.c
--- a/gcc/testsuite/gcc.dg/lto/modref-4_0.c
+++ b/gcc/testsuite/gcc.dg/lto/modref-4_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do run } */
 /* { dg-lto-options { {-O2 -flto-partition=max -fdump-ipa-modref -fno-ipa-sra -flto} } } */
+/* { dg-require-effective-target linker_plugin } */
 extern void copy (int *a, int *b);
 extern void barrier ();
 extern int *ptr;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -9914,6 +9914,7 @@ proc is-effective-target { arg } {
 	  "htm_hw" { set selected [check_htm_hw_available] }
 	  "named_sections" { set selected [check_named_sections_available] }
 	  "gc_sections"{ set selected [check_gc_sections_available] }
+	  "linker_plugin"  { set selected [check_linker_plugin_available] }
 	  "cxa_atexit" { set selected [check_cxa_atexit_available] }
 	  default  { error "unknown effective target keyword `$arg'" }
 	}


[PATCH] testsuite: gdc: Require ucn in gdc.test/runnable/mangle.d etc. [PR104739]

2024-02-14 Thread Rainer Orth
gdc.test/runnable/mangle.d and two other tests come out UNRESOLVED on
Solaris with the native assembler:

UNRESOLVED: gdc.test/runnable/mangle.d   compilation failed to produce 
executable
UNRESOLVED: gdc.test/runnable/mangle.d -shared-libphobos   compilation failed 
to produce executable
UNRESOLVED: gdc.test/runnable/testmodule.d   compilation failed to produce 
executable 
UNRESOLVED: gdc.test/runnable/testmodule.d -shared-libphobos   compilation 
failed to produce executable
UNRESOLVED: gdc.test/runnable/ufcs.d   compilation failed to produce executable
UNRESOLVED: gdc.test/runnable/ufcs.d -shared-libphobos   compilation failed to 
produce executable

Assembler: mangle.d
"/var/tmp//cci9q2Sc.s", line 115 : Syntax error
Near line: "movzbl  test_эльфийские_письмена_9, %eax"
"/var/tmp//cci9q2Sc.s", line 115 : Syntax error
Near line: "movzbl  test_эльфийские_письмена_9, %eax"
"/var/tmp//cci9q2Sc.s", line 115 : Syntax error
Near line: "movzbl  test_эльфийские_письмена_9, %eax"
"/var/tmp//cci9q2Sc.s", line 115 : Syntax error
Near line: "movzbl  test_эльфийские_письмена_9, %eax"
"/var/tmp//cci9q2Sc.s", line 115 : Syntax error
[...]

since /bin/as lacks UCN support.

Iain recently added UNICODE_NAMES: annotations to the affected tests and
those recently were imported into trunk.

This patch handles the DejaGnu side of things, adding

{ dg-require-effective-target ucn }

to those tests on the fly.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11 (as and gas each),
and x86_64-pc-linux-gnu.

Ok for trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-03  Rainer Orth  

gcc/testsuite:
PR d/104739
* lib/gdc-utils.exp (gdc-convert-test) : Require
ucn support.

# HG changeset patch
# Parent  5072a8062cf1eac00205b715f4c1af31c9fc45ca
testsuite: gdc: Require ucn in gdc.test/runnable/mangle.d etc. [PR104739]

diff --git a/gcc/testsuite/lib/gdc-utils.exp b/gcc/testsuite/lib/gdc-utils.exp
--- a/gcc/testsuite/lib/gdc-utils.exp
+++ b/gcc/testsuite/lib/gdc-utils.exp
@@ -244,6 +244,7 @@ proc gdc-copy-file { srcdir filename } {
 #   POST_SCRIPT:	Not handled.
 #   REQUIRED_ARGS:	Arguments to add to the compiler command line.
 #   DISABLED:		Not handled.
+#   UNICODE_NAMES:	Requires ucn support.
 #
 
 proc gdc-convert-test { base test } {
@@ -365,6 +366,10 @@ proc gdc-convert-test { base test } {
 	# COMPILABLE_MATH_TEST annotates tests that import the std.math
 	# module.  Which will need skipping if not available on the target.
 	set needs_phobos 1
+	} elseif [regexp -- {UNICODE_NAMES} $copy_line] {
+	# Require ucn support.
+	puts $fdout "// { dg-require-effective-target ucn }"
+
 	}
 }
 


[COMMITTED] testsuite: i386: Skip gcc.target/i386/pr113689-1.c etc. on Solaris [PR113909]

2024-02-14 Thread Rainer Orth
gcc.target/i386/pr113689-[1-3].c FAIL on 64-bit Solaris/x86:

FAIL: gcc.target/i386/pr113689-1.c (test for excess errors)
UNRESOLVED: gcc.target/i386/pr113689-1.c compilation failed to produce 
executable
FAIL: gcc.target/i386/pr113689-2.c (test for excess errors)
UNRESOLVED: gcc.target/i386/pr113689-2.c compilation failed to produce 
executable
FAIL: gcc.target/i386/pr113689-3.c (test for excess errors)
UNRESOLVED: gcc.target/i386/pr113689-3.c compilation failed to produce 
executable

with

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/i386/pr113689-1.c:43:1: 
sorry, unimplemented: no register available for profiling '-mcmodel=large'

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/i386/pr113689-2.c:26:1: 
sorry, unimplemented: profiling '-mcmodel=large' with PIC is not supported

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/i386/pr113689-3.c:15:1: 
sorry, unimplemented: profiling '-mcmodel=large' with PIC is not supported

This happens because i386/sol2.h doesn't define NO_PROFILE_COUNTERS.

So this patch just skips the tests on Solaris.

Tested on i386-pc-solaris2.11.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-13  Rainer Orth  

gcc/testsuite:
PR target/113909
* gcc.target/i386/pr113689-1.c: Skip on Solaris.
* gcc.target/i386/pr113689-2.c: Likewise.
* gcc.target/i386/pr113689-3.c: Likewise.

# HG changeset patch
# Parent  541a06a663a132cbcf1467a248d1229e290a65ab
testsuite: i386: Skip gcc.target/i386/pr113689-1.c etc. on Solaris

diff --git a/gcc/testsuite/gcc.target/i386/pr113689-1.c b/gcc/testsuite/gcc.target/i386/pr113689-1.c
--- a/gcc/testsuite/gcc.target/i386/pr113689-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr113689-1.c
@@ -1,6 +1,7 @@
 /* { dg-do run { target { lp64 && fpic } } } */
 /* { dg-options "-O2 -fno-pic -fprofile -mcmodel=large" } */
 /* { dg-skip-if "PR90698" { *-*-darwin* } } */
+/* { dg-skip-if "PR113909" { *-*-solaris2* } } */
 
 #include 
 
diff --git a/gcc/testsuite/gcc.target/i386/pr113689-2.c b/gcc/testsuite/gcc.target/i386/pr113689-2.c
--- a/gcc/testsuite/gcc.target/i386/pr113689-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr113689-2.c
@@ -1,6 +1,7 @@
 /* { dg-do run { target { lp64 && fpic } } } */
 /* { dg-options "-O2 -fpic -fprofile -mcmodel=large" } */
 /* { dg-skip-if "PR90698" { *-*-darwin* } } */
+/* { dg-skip-if "PR113909" { *-*-solaris2* } } */
 
 __attribute__((noipa))
 void
diff --git a/gcc/testsuite/gcc.target/i386/pr113689-3.c b/gcc/testsuite/gcc.target/i386/pr113689-3.c
--- a/gcc/testsuite/gcc.target/i386/pr113689-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr113689-3.c
@@ -1,6 +1,7 @@
 /* { dg-do run { target { lp64 && fpic } } } */
 /* { dg-options "-O2 -fpic -fprofile -mcmodel=large" } */
 /* { dg-skip-if "PR90698" { *-*-darwin* } } */
+/* { dg-skip-if "PR113909" { *-*-solaris2* } } */
 
 #include 
 


[COMMITTED] testsuite: gfortran: Remove obsolete references to Solaris 9

2024-02-14 Thread Rainer Orth
Some gfortran tests still contain references to long-obsolete Solaris 9.

This patch removes them.

Tested on i386-pc-solaris2.11.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-13  Rainer Orth  

gcc/testsuite:
* gfortran.dg/fmt_en.f90 (dg-output): Don't xfail on
?86-*-solaris2.9*.
* gfortran.dg/fmt_en_rd.f90: Likewise.
* gfortran.dg/fmt_en_rn.f90: Likewise.
* gfortran.dg/fmt_en_ru.f90: Likewise.
* gfortran.dg/fmt_en_rz.f90: Likewise.

# HG changeset patch
# Parent  8c800c0f81d703746d07e942672856e9bf7eaf30
testsuite: Remove obsolete references to Solaris 9

diff --git a/gcc/testsuite/gfortran.dg/fmt_en.f90 b/gcc/testsuite/gfortran.dg/fmt_en.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en.f90
@@ -180,4 +180,4 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to nearest" { xfail hppa*-*-hpux* } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rd.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rd.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded down" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded down" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rn.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rn.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to nearest" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_ru.f90 b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_ru.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded up" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded up" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_en_rz.f90 b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
--- a/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_en_rz.f90
@@ -181,5 +181,5 @@ contains
 
 end subroutine
 end program
-! { dg-output "All kinds rounded to zero" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
+! { dg-output "All kinds rounded to zero" { xfail hppa*-*-hpux* } }
 ! { dg-final { cleanup-saved-temps } }


[PATCH] libgm2: Fix libm2iso/wraptime.cc compilation on Solaris

2024-02-13 Thread Rainer Orth
As it turned out, my patch to complete the libgm2 autoconf macros works
on both Linux/sparc64 and Linux/x86_64, but breaks Solaris bootstrap:

/vol/gcc/src/hg/master/local/libgm2/libm2iso/wraptime.cc: In function 'int 
m2iso_wraptime_gettimeofday(void*, timezone*)':
/vol/gcc/src/hg/master/local/libgm2/libm2iso/wraptime.cc:148:24: error: invalid 
conversion from 'void*' to 'timeval*' [-fpermissive]
  148 |   return gettimeofday (tv, tz);
  |^~
  ||
  |void*
In file included from /usr/include/sys/select.h:27,
 from /usr/include/sys/types.h:665,
 from 
/vol/gcc/src/hg/master/local/libgm2/libm2iso/wraptime.cc:35:
/usr/include/sys/time.h:444:18: note:   initializing argument 1 of 'int 
gettimeofday(timeval*, void*)'
  444 | int gettimeofday(struct timeval *_RESTRICT_KYWD, void *_RESTRICT_KYWD);
  |  ^
/vol/gcc/src/hg/master/local/libgm2/libm2iso/wraptime.cc: In function 'int 
m2iso_wraptime_settimeofday(void*, timezone*)':
/vol/gcc/src/hg/master/local/libgm2/libm2iso/wraptime.cc:165:24: error: invalid 
conversion from 'void*' to 'timeval*' [-fpermissive]
  165 |   return settimeofday (tv, tz);
  |^~
  ||
  |void*
/usr/include/sys/time.h:431:18: note:   initializing argument 1 of 'int 
settimeofday(timeval*, void*)'
  431 | int settimeofday(struct timeval *, void *);
  |  ^~~~

This happens because on Linux only HAVE_[GS]ETTIMEOFDAY is defined,
while Solaris has both that and HAVE_STRUCT_TIMEZONE, selecting
different implementations.

Fixed by casting tv to struct timeval *.

I thought about changing the signatures instead to take a struct timeval
* instead, but that seemed risky given that there's a
HAVE_STRUCT_TIMEVAL, so would probably break other targets.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-13  Rainer Orth  

libgm2:
* libm2iso/wraptime.cc [HAVE_STRUCT_TIMEZONE && HAVE_GETTIMEOFDAY]
(EXPORT(gettimeofday)): Cast tv to struct timeval *.
[HAVE_STRUCT_TIMEZONE && HAVE_SETTIMEOFDAY]
(EXPORT(settimeofday)): Likewise.

# HG changeset patch
# Parent  54196105ece9b22dbacfebb0bebd5c857cd5c19a
libgm2: Fix libm2iso/wraptime.cc compilation on Solaris

diff --git a/libgm2/libm2iso/wraptime.cc b/libgm2/libm2iso/wraptime.cc
--- a/libgm2/libm2iso/wraptime.cc
+++ b/libgm2/libm2iso/wraptime.cc
@@ -145,7 +145,7 @@ EXPORT(KillTM) (struct tm *tv)
 extern "C" int
 EXPORT(gettimeofday) (void *tv, struct timezone *tz)
 {
-  return gettimeofday (tv, tz);
+  return gettimeofday ((struct timeval *) tv, tz);
 }
 #else
 extern "C" int
@@ -162,7 +162,7 @@ EXPORT(gettimeofday) (void *tv, void *tz
 extern "C" int
 EXPORT(settimeofday) (void *tv, struct timezone *tz)
 {
-  return settimeofday (tv, tz);
+  return settimeofday ((struct timeval *) tv, tz);
 }
 #else
 extern "C" int


Re: [PATCH] testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706]

2024-02-13 Thread Rainer Orth
Hi Jason,

> On 2/2/24 10:23, Rainer Orth wrote:
>> c-c++-common/pr103798-2.c FAILs on Solaris when compiled as C++:
>> FAIL: c-c++-common/pr103798-2.c  -std=gnu++14  scan-assembler-not memchr
>> FAIL: c-c++-common/pr103798-2.c  -std=gnu++17  scan-assembler-not memchr
>> FAIL: c-c++-common/pr103798-2.c  -std=gnu++20  scan-assembler-not memchr
>> FAIL: c-c++-common/pr103798-2.c  -std=gnu++98  scan-assembler-not memchr
>> As H.J. analyzed in the PR, Solaris  declares std::memchr, not
>> memchr, which isn't treated as __builtin_memchr.
>
> The problem seems to be not the std::, but that the Solaris string.h
> declares
>
> const void *memchr(const void *, int, size_t);
>
> as specified by the C++ standard, while gcc expects the return type to be
> void* like in C.
>
> This looks like a GCC bug, not Solaris; I'd prefer to xfail the testcase
> rather than work around the compiler bug.

thanks for the analysis.

What I found with my current patch, just the memchr prototype changed to
always return const void *, the test still PASSes as C, but FAILs as
C++.

In the C++ case I get a warning:

/vol/gcc/src/hg/master/local/gcc/testsuite/c-c++-common/pr103798-2.c:10:20: 
warning: declaration of ‘const void* memchr(const void*, int, size_t)’ 
conflicts with built-in declaration ‘void* memchr(const void*, int, unsigned 
int)’ [-Wbuiltin-declaration-mismatch]

Here's the patch to xfail the test instead.

Tested on sparc-sun-solaris2.11 and x86_64-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
---------
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-12  Rainer Orth  

testsuite:
PR tree-optimization/113706
* c-c++-common/pr103798-2.c (scan-assembler-not): xfail for C++ on
Solaris.


# HG changeset patch
# Parent  1409f56e818a7240dd65da9566400f308a996beb
testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706]

diff --git a/gcc/testsuite/c-c++-common/pr103798-2.c b/gcc/testsuite/c-c++-common/pr103798-2.c
--- a/gcc/testsuite/c-c++-common/pr103798-2.c
+++ b/gcc/testsuite/c-c++-common/pr103798-2.c
@@ -27,4 +27,5 @@ main ()
  return 0;
 }
 
-/* { dg-final { scan-assembler-not "memchr" } } */
+/* See PR tree-optimization/113706 for the xfail.  */
+/* { dg-final { scan-assembler-not "memchr" { xfail { c++ && *-*-solaris2* } } } } */


Unreviewed c++ and libgomp testsuite patches

2024-02-12 Thread Rainer Orth
The following patches have remained unreviewed for a week or more:

testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706]
https://gcc.gnu.org/pipermail/gcc-patches/2024-February/644842.html

Probably needs a C++ maintainer, although I've Cc'ed the testcase author
for good measure.

libgomp: testsuite: Don't XPASS libgomp.c/alloc-pinned-1.c etc. on 
non-Linux targets [PR113448]
https://gcc.gnu.org/pipermail/gcc-patches/2024-February/644967.html

Needs a libgomp maintainer (or the testcase author).

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] libgm2: Define missing configure macros [PR113888]

2024-02-12 Thread Rainer Orth
As detailed in PR modula2/113888, the 32-bit libm2pim/target.c doesn't
assemble in a Linux/sparc64 multilib build.  However, the root cause is
that the HAVE_EXP10* macros are never defined.  While I was at it, I
checked for other cases where the code uses HAVE_* macros that are
missing from config.h.in.

This patch adds the missing checks, changes the configure checks where
the names don't match what's used in the code, or corrects the code to
use the right names.

So far tested on sparc64-unknown-linux-gnu by building libgm2 (32 and
64-bit) and running the gm2 tests.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-12  Rainer Orth  

libmgm2:
PR modula2/113888
* configure.ac (GM2_CHECK_LIB): Rename gettimeofday guard to
HAVE_GETTIMEOFDAY.
(GM_CHECK_LIB): Check for settimeofday.
(GM2_CHECK_LIB): Check for exp10, exp10f, exp10l in libm.
(AC_CHECK_DECLS): Check for getenv.
* configure, config.h.in: Regenerate.
* libm2pim/dtoa.cc: Rename ,  guards to
HAVE_STRINGS_H, HAVE_STRING_H.
* libm2pim/ldtoa.cc: Likewise.

# HG changeset patch
# Parent  4f9cde8a5ed4b67cc625923887c1fcf610e8234c
libgm2: Define missing configure macros [PR113888]

diff --git a/libgm2/configure.ac b/libgm2/configure.ac
--- a/libgm2/configure.ac
+++ b/libgm2/configure.ac
@@ -297,7 +297,7 @@ GM2_CHECK_LIB([c],[getgid],[GETGID])
 GM2_CHECK_LIB([c],[getopt_long],[GETOPT_LONG])
 GM2_CHECK_LIB([c],[getopt_long_only],[GETOPT_LONG_ONLY])
 GM2_CHECK_LIB([c],[getpid],[GETPID])
-GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFD])
+GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFDAY])
 GM2_CHECK_LIB([c],[getuid],[GETUID])
 GM2_CHECK_LIB([c],[ioctl],[IOCTL])
 GM2_CHECK_LIB([c],[kill],[KILL])
@@ -311,6 +311,7 @@ GM2_CHECK_LIB([c],[read],[READ])
 GM2_CHECK_LIB([c],[select],[SELECT])
 GM2_CHECK_LIB([c],[setitimer],[SETITIMER])
 GM2_CHECK_LIB([c],[setgid],[SETGID])
+GM2_CHECK_LIB([c],[settimeofday],[SETTIMEOFDAY])
 GM2_CHECK_LIB([c],[setuid],[SETUID])
 GM2_CHECK_LIB([c],[stat],[STAT])
 GM2_CHECK_LIB([c],[strsignal],[STRSIGNAL])
@@ -323,10 +324,15 @@ GM2_CHECK_LIB([c],[unlink],[UNLINK])
 GM2_CHECK_LIB([c],[wait],[WAIT])
 GM2_CHECK_LIB([c],[write],[WRITE])
 
+GM2_CHECK_LIB([m],[exp10],[EXP10])
+GM2_CHECK_LIB([m],[exp10f],[EXP10F])
+GM2_CHECK_LIB([m],[exp10l],[EXP10L])
 GM2_CHECK_LIB([m],[signbit],[SIGNBIT])
 GM2_CHECK_LIB([m],[signbitf],[SIGNBITF])
 GM2_CHECK_LIB([m],[signbitl],[SIGNBITL])
 
+AC_CHECK_DECLS([getenv])
+
 AC_MSG_NOTICE([libgm2 has finished checking target libc and libm contents.])
 
 # We test the host here and later on check the target.
diff --git a/libgm2/libm2pim/dtoa.cc b/libgm2/libm2pim/dtoa.cc
--- a/libgm2/libm2pim/dtoa.cc
+++ b/libgm2/libm2pim/dtoa.cc
@@ -33,11 +33,11 @@ see the files COPYING3 and COPYING.RUNTI
 #define M2EXPORT(FUNC) m2pim ## _M2_dtoa_ ## FUNC
 #define M2LIBNAME "m2pim"
 
-#if defined(HAVE_STRINGS)
+#if defined(HAVE_STRINGS_H)
 #include 
 #endif
 
-#if defined(HAVE_STRING)
+#if defined(HAVE_STRING_H)
 #include 
 #endif
 
diff --git a/libgm2/libm2pim/ldtoa.cc b/libgm2/libm2pim/ldtoa.cc
--- a/libgm2/libm2pim/ldtoa.cc
+++ b/libgm2/libm2pim/ldtoa.cc
@@ -34,11 +34,11 @@ see the files COPYING3 and COPYING.RUNTI
 #define M2EXPORT(FUNC) m2pim ## _M2_ldtoa_ ## FUNC
 #define M2LIBNAME "m2pim"
 
-#if defined(HAVE_STRINGS)
+#if defined(HAVE_STRINGS_H)
 #include 
 #endif
 
-#if defined(HAVE_STRING)
+#if defined(HAVE_STRING_H)
 #include 
 #endif
 


[COMMITTED] testsuite: Don't xfail gcc.dg/debug/dwarf2/inline5.c

2024-02-07 Thread Rainer Orth
gcc.dg/debug/dwarf2/inline5.c has been XPASSing on Solaris (both SPARC
and x86, 32 and 64-bit) with the native assembler since 20210429.
According to gcc-testresults postings, the same is true on AIX.

XPASS: gcc.dg/debug/dwarf2/inline5.c scan-assembler-not (DIE 
(0x([0-9a-f]*)) DW_TAG_lexical_block)[^#/!@;|]*[#/!@;|]+ 
+DW_AT.*DW_TAG_lexical_block)[^#/!@;|x]*x1[^#/!@;|]*[#/!@;|]
 +DW_AT_abstract_origin

This is obviously due to

commit 16683cefc636636ba6fed23fe0de89ed19bc7876
Author: Alexandre Oliva 
Date:   Wed Apr 28 14:07:41 2021 -0300

fix asm-not pattern in dwarf2/inline5.c

This patch thus removes the xfail.

Tested on i386-pc-solaris2.11 (as and gas), sparc-sun-solaris2.11 (as
and gas), and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-06  Rainer Orth  

gcc/testsuite:
* gcc.dg/debug/dwarf2/inline5.c: Don't xfail scan-assembler-not on
{ aix || solaris2 } && !gas.

# HG changeset patch
# Parent  5e88f4bb18b22df244fb83dd9c18eafa9a34bf70
testsuite: Don't xfail gcc.dg/debug/dwarf2/inline5.c

diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline5.c
@@ -9,7 +9,7 @@
 /* We do not know which is output first so look for both invalid abstract
origins on the lexical blocks (knowing that the abstract instance has
no attribute following the DW_TAG_lexical_block.  */
-/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT.*DW_TAG_lexical_block\\)\[^#/!@;\\|x\]*x\\1\[^#/!@;\\|\]*\[#/!@;\\|\] +DW_AT_abstract_origin" { xfail { { *-*-aix* || *-*-solaris2.* } && { ! gas } } } } } */
+/* { dg-final { scan-assembler-not "\\(DIE \\(0x(\[0-9a-f\]*)\\) DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT.*DW_TAG_lexical_block\\)\[^#/!@;\\|x\]*x\\1\[^#/!@;\\|\]*\[#/!@;\\|\] +DW_AT_abstract_origin" } } */
 /* { dg-final { scan-assembler-not "DW_TAG_lexical_block\\)\[^#/!@;\\|x\]*x(\[0-9a-f\]*)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT_abstract_origin.*\\(DIE \\(0x\\1\\) DW_TAG_lexical_block\\)\[^#/!@;\\|\]*\[#/!@;\\|\]+ +DW_AT" } } */
 
 int foo (int i)


Re: [PATCH] libssp: Fix gets-chk.c compilation on Solaris

2024-02-06 Thread Rainer Orth
Hi Jakub,

sorry for dropping the ball on this.

> On Mon, Dec 04, 2023 at 11:42:09AM +0100, Rainer Orth wrote:
>> The recent warning patches broke the libssp build on Solaris:
>> 
>> /vol/gcc/src/hg/master/local/libssp/gets-chk.c: In function '__gets_chk':
>> /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: implicit
>> declaration of function 'gets'; did you mean 'getw'?
>> [-Wimplicit-function-declaration]
>>67 | return gets (s);
>>   |^~~~
>>   |getw 
>> /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: returning
>> 'int' from a function with return type 'char *' makes pointer from
>> integer without a cast [-Wint-conversion]
>>67 | return gets (s);
>>   |^~~~
>> /vol/gcc/src/hg/master/local/libssp/gets-chk.c:74:12: error: returning
>> 'int' from a function with return type 'char *' makes pointer from
>> integer without a cast [-Wint-conversion]
>>74 | return gets (s);
>>   |^~~~
>> 
>> The guard around the gets declaration in gets-chk.c is
>> 
>> #if !(!defined __USE_ISOC11 \
>>   || (defined __cplusplus && __cplusplus <= 201103L))
>> extern char *gets (char *);
>> #endif
>> 
>> __USE_ISOC11 is a glibc-only thing, while Solaris 
>> declares gets like
>> 
>> #if __STDC_VERSION__ < 201112L && __cplusplus < 201402L
>> extern char *gets(char *) __ATTR_DEPRECATED;
>> #endif
>> 
>> If one needs to check __USE_ISO11 at all, one certainly needs to check
>> __STDC_VERSION__ to avoid breaking every non-glibc target.  Besides, I
>> don't see what's the use of checking __cplusplus when compiling a C-only
>> source file.  On top of all that, the double negation makes the guard
>> unnecessarily hard to understand.
>> 
>> I really don't know if it's useful/appropriate to check __USE_ISOC11 and
>> __cplusplus here at all; still I've left both for now.
>> 
>> Here's what I've used to complete the Solaris bootstrap.
>> 
>> Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11,
>> x86_64-pc-linux-gnu, and x86_64-apple-darwin23.1.0.
>> 
>> -- 
>> -
>> Rainer Orth, Center for Biotechnology, Bielefeld University
>> 
>> 
>> 2023-12-03  Rainer Orth  
>> 
>>  libssp:
>>  * gets-chk.c (gets): Avoid double negation.
>>  Also check __STDC_VERSION__ >= 201112L.
>> 
>
>> # HG changeset patch
>> # Parent  334015ab01f6c0e5af821c1e9bc83b8677cc0bfb
>> libssp: Fix gets-chk.c compilation on Solaris
>> 
>> diff --git a/libssp/gets-chk.c b/libssp/gets-chk.c
>> --- a/libssp/gets-chk.c
>> +++ b/libssp/gets-chk.c
>> @@ -51,8 +51,9 @@ see the files COPYING3 and COPYING.RUNTI
>>  # include 
>>  #endif
>>  
>> -#if !(!defined __USE_ISOC11 \
>> -  || (defined __cplusplus && __cplusplus <= 201103L))
>> +#if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)   \
>> + || !defined __USE_ISOC11   \
>> + || (defined __cplusplus && __cplusplus >= 201402L)
>
> The above isn't equivalent.  Avoiding double negation would mean
> #if (defined __USE_ISOC11 \
>  && !(defined __cplusplus && __cplusplus <= 201103L))
> or
> #if (defined __USE_ISOC11 \
>  && (!defined __cplusplus || __cplusplus > 201103L))
> No?
> __USE_ISOC11 is defined as
> /* This is to enable the ISO C11 extension.  */
> #if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \
>  || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
> # define __USE_ISOC11   1
> #endif
> where _ISOC11_SOURCE or _ISOC2X_SOURCE are defined whenever _GNU_SOURCE
> is or when user defines them, or __USE_ISOC11 is also defined for
> if __cplusplus >= 201703L.
>
> Obviously, if you add that
>   (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
> it will mean it will be prototyped always (as I think we compile it without
> any -std= flags).
>
> What about using what we had for glibc (or even better, expect gets
> to be declared for glibc < 2.16) and use what you add for other libraries?
> The file is written and compiled as C, so we don't need to bother with C++
> though.
> So
> #if (defined (__GLIBC_PREREQ) \
>  ? (__GLI

[PATCH] libgcc: Export i386 symbols added after GCC_7.0.0 on Solaris [PR113700]

2024-02-06 Thread Rainer Orth
As reported in the PR, all libgcc x86 symbol versions added after
GCC_7.0.0 were only added to i386/libgcc-glibc.ver, missing all of
libgcc-sol2.ver, libgcc-bsd.ver, and libgcc-darwin.ver.

This patch fixes this for Solaris/x86, adding all of them
(GCC_1[234].0.0) as GCC_14.0.0 to not retroactively change history.

Since this isn't the first time this happens, I've added a note to the
end of libgcc-glibc.ver to request notifying other maintainers in case
of additions.

Tested on i386-pc-solaris2.11.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

libgcc:
* config/i386/libgcc-sol2.ver (GCC_14.0.0): Added all symbols from
i386/libgcc-glibc.ver (GCC_12.0.0, GCC_13.0.0, GCC_14.0.0).
* config/i386/libgcc-glibc.ver: Request notifications on updates.

# HG changeset patch
# Parent  e582765ce980229b4c3ae5afc6a28e5aa480cdaf
libgcc: Export i386 symbols added after GCC_7.0.0 on Solaris [PR113700]

diff --git a/libgcc/config/i386/libgcc-glibc.ver b/libgcc/config/i386/libgcc-glibc.ver
--- a/libgcc/config/i386/libgcc-glibc.ver
+++ b/libgcc/config/i386/libgcc-glibc.ver
@@ -236,3 +236,7 @@ GCC_14.0.0 {
   __floatbitintxf
   __floatbitinttf
 }
+
+# Please notify the maintainers of libgcc-{bsd,darwin,sol2}.ver of any
+# additions.  Those version scripts usually need to be kept in sync with
+# libgcc-glibc.ver.
diff --git a/libgcc/config/i386/libgcc-sol2.ver b/libgcc/config/i386/libgcc-sol2.ver
--- a/libgcc/config/i386/libgcc-sol2.ver
+++ b/libgcc/config/i386/libgcc-sol2.ver
@@ -115,3 +115,39 @@ GCC_4.8.0 {
 GCC_7.0.0 {
   __signbittf2
 }
+
+GCC_14.0.0 {
+  # Added to GCC_12.0.0 in i386/libgcc-glibc.
+  __divhc3
+  __mulhc3
+  __eqhf2
+  __nehf2
+  __extendhfdf2
+  __extendhfsf2
+  __extendhftf2
+  __extendhfxf2
+  __fixhfti
+  __fixunshfti
+  __floattihf
+  __floatuntihf
+  __truncdfhf2
+  __truncsfhf2
+  __trunctfhf2
+  __truncxfhf2
+  # Added to GCC_13.0.0 in i386/libgcc-glibc.
+  __extendbfsf2
+  __floattibf
+  __floatuntibf
+  __truncdfbf2
+  __truncsfbf2
+  __trunctfbf2
+  __truncxfbf2
+  __trunchfbf2
+  # Added to GCC_14.0.0 in i386/libgcc-glibc.
+  __fixxfbitint
+  __fixtfbitint
+  __floatbitintbf
+  __floatbitinthf
+  __floatbitintxf
+  __floatbitinttf
+}


[PATCH] libgomp: testsuite: Don't XPASS libgomp.c/alloc-pinned-1.c etc. on non-Linux targets [PR113448]

2024-02-05 Thread Rainer Orth
Two libgomp tests XPASS on Solaris (any non-Linux target actually) since
their introduction:

XPASS: libgomp.c/alloc-pinned-1.c execution test
XPASS: libgomp.c/alloc-pinned-2.c execution test

The problem is that the test just prints

OS unsupported

and exits successfully, while the test is XFAILed:

/* { dg-xfail-run-if "Pinning not implemented on this host" { ! *-*-linux-gnu } 
} */

Fixed by aborting immediately after the message above in the non-Linux
case.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-02  Rainer Orth  

libgomp:
PR testsuite/113448
* testsuite/libgomp.c/alloc-pinned-1.c [!__linux__] (CHECK_SIZE):
Call abort.
* testsuite/libgomp.c/alloc-pinned-2.c [!__linux__] (CHECK_SIZE):
Likewise.

# HG changeset patch
# Parent  b7015efde7d6a48dd520698b470fcaf824758f21
libgomp: testsuite: Fix libgomp.c/alloc-pinned-1.c etc. on non-Linux targets [PR113085]

diff --git a/libgomp/testsuite/libgomp.c/alloc-pinned-1.c b/libgomp/testsuite/libgomp.c/alloc-pinned-1.c
--- a/libgomp/testsuite/libgomp.c/alloc-pinned-1.c
+++ b/libgomp/testsuite/libgomp.c/alloc-pinned-1.c
@@ -45,7 +45,10 @@ get_pinned_mem ()
 }
 #else
 #define PAGE_SIZE 1024 /* unknown */
-#define CHECK_SIZE(SIZE) fprintf (stderr, "OS unsupported\n");
+#define CHECK_SIZE(SIZE) { \
+  fprintf (stderr, "OS unsupported\n"); \
+  abort (); \
+  }
 #define EXPECT_OMP_NULL_ALLOCATOR
 
 int
diff --git a/libgomp/testsuite/libgomp.c/alloc-pinned-2.c b/libgomp/testsuite/libgomp.c/alloc-pinned-2.c
--- a/libgomp/testsuite/libgomp.c/alloc-pinned-2.c
+++ b/libgomp/testsuite/libgomp.c/alloc-pinned-2.c
@@ -45,12 +45,16 @@ get_pinned_mem ()
 }
 #else
 #define PAGE_SIZE 1024 /* unknown */
-#define CHECK_SIZE(SIZE) fprintf (stderr, "OS unsupported\n");
+#define CHECK_SIZE(SIZE) { \
+  fprintf (stderr, "OS unsupported\n"); \
+  abort (); \
+  }
 #define EXPECT_OMP_NULL_ALLOCATOR
 
 int
 get_pinned_mem ()
 {
+  abort ();
   return 0;
 }
 #endif


[PATCH] testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706]

2024-02-02 Thread Rainer Orth
c-c++-common/pr103798-2.c FAILs on Solaris when compiled as C++:

FAIL: c-c++-common/pr103798-2.c  -std=gnu++14  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++17  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++20  scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c  -std=gnu++98  scan-assembler-not memchr

As H.J. analyzed in the PR, Solaris  declares std::memchr, not
memchr, which isn't treated as __builtin_memchr.

To avoid this, this patch declares memchr directly instead of including
.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
PR tree-optimization/113706
* c-c++-common/pr103798-2.c (NULL): Define.
(size_t, memchr): Declare instead of including .

# HG changeset patch
# Parent  943813561aef290adb442042f9c4fecd82ee
testsuite: Fix c-c++-common/pr103798-2.c on Solaris [PR113706]

diff --git a/gcc/testsuite/c-c++-common/pr103798-2.c b/gcc/testsuite/c-c++-common/pr103798-2.c
--- a/gcc/testsuite/c-c++-common/pr103798-2.c
+++ b/gcc/testsuite/c-c++-common/pr103798-2.c
@@ -1,7 +1,16 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -fdump-tree-optimized -save-temps" } */
 
-#include 
+#define NULL ((void *) 0)
+
+typedef __SIZE_TYPE__ size_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void *memchr (const void *, int, size_t);
+#ifdef __cplusplus
+}
+#endif
 
 __attribute__ ((weak))
 int


[COMMITTED] testsuite: i386: Fix gcc.target/i386/sse2-stv-1.c on Solaris/x86

2024-02-02 Thread Rainer Orth
gcc.target/i386/sse2-stv-1.c FAILs on 32-bit Solaris/x86:

FAIL: gcc.target/i386/sse2-stv-1.c scan-assembler-not %[er]sp
FAIL: gcc.target/i386/sse2-stv-1.c scan-assembler-not shldl

The test assumes the Linux/x86 default of -mno-stackrealign, while
32-bit Solaris/x86 default to -mstackrealign.

Fixed by explicitly specifying -mno-stackrealign.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/sse2-stv-1.c (dg-options): Add -mno-stackrealign.

# HG changeset patch
# Parent  1b69d161152aa71acfac15a0d29081f891eb8598
testsuite: i386: Fix gcc.target/i386/sse2-stv-1.c on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/sse2-stv-1.c b/gcc/testsuite/gcc.target/i386/sse2-stv-1.c
--- a/gcc/testsuite/gcc.target/i386/sse2-stv-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-stv-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target ia32 } } */
-/* { dg-options "-O2 -msse2" } */
+/* { dg-options "-O2 -msse2 -mno-stackrealign" } */
 
 unsigned long long a,b,c,d;
 


[COMMITTED] testsuite: i386: Restrict gcc.target/i386/pr80569.c to gas

2024-02-02 Thread Rainer Orth
gcc.target/i386/pr80569.c FAILs on Solaris/x86 with the native
assembler:

FAIL: gcc.target/i386/pr80569.c (test for excess errors)

Excess errors:
Assembler: pr80569.c 
"/var/tmp//ccm4_iqb.s", line 2 : Illegal mnemonic
Near line: ".code16gcc"
"/var/tmp//ccm4_iqb.s", line 2 : Syntax error
Near line: ".code16gcc"

.code16gcc is a gas extension, so restrict the test to gas.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pr80569.c: Require gas.

# HG changeset patch
# Parent  1d2125161d5c03f6695de16e4e8608ed7a0d8163
testsuite: i386: Restrict gcc.target/i386/pr80569.c to gas

diff --git a/gcc/testsuite/gcc.target/i386/pr80569.c b/gcc/testsuite/gcc.target/i386/pr80569.c
--- a/gcc/testsuite/gcc.target/i386/pr80569.c
+++ b/gcc/testsuite/gcc.target/i386/pr80569.c
@@ -1,6 +1,8 @@
 /* PR target/80569 */
 /* { dg-do assemble } */
 /* { dg-options "-O2 -m16 -march=haswell" } */
+/* Non-gas assemblers choke on .code16gcc.  */
+/* { dg-require-effective-target gas } */
 
 void load_kernel(void *setup_addr)
 {


[PATCH] testsuite: i386: Fix gcc.target/i386/pr71321.c on Solaris/x86

2024-02-02 Thread Rainer Orth
gcc.target/i386/pr71321.c FAILs on 64-bit Solaris/x86 with the native
assembler:

FAIL: gcc.target/i386/pr71321.c scan-assembler-not lea.*0

The problem is that /bin/as doesn't fully support cfi directives, so the
.eh_frame section is specified explicitly, which includes ".long 0".
The regular expression above includes ".*", which does multiline
matches.  AFAICS those aren't needed here.

This patch changes the RE not to use multiline patches.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pr71321.c (scan-assembler-not): Avoid multiline
matches.

# HG changeset patch
# Parent  f2342e77e566f9b5bdb221afd339753dcb4d1723
testsuite: i386: Fix gcc.target/i386/pr71321.c on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/pr71321.c b/gcc/testsuite/gcc.target/i386/pr71321.c
--- a/gcc/testsuite/gcc.target/i386/pr71321.c
+++ b/gcc/testsuite/gcc.target/i386/pr71321.c
@@ -12,4 +12,4 @@ unsigned cvt_to_2digit_ascii(uint8_t i)
 {
   return cvt_to_2digit(i, 10) + 0x0a3030;
 }
-/* { dg-final { scan-assembler-not "lea.*0" } } */
+/* { dg-final { scan-assembler-not "lea\[^\n\r]*0" } } */


[COMMITTED] testsuite: i386: Fix gcc.target/i386/pieces-memcpy-7.c etc. on Solaris/x86

2024-02-02 Thread Rainer Orth
gcc.target/i386/pieces-memcpy-7.c etc. FAIL on 32-bit Solaris/x86:

FAIL: gcc.target/i386/pieces-memcpy-7.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memcpy-8.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memcpy-9.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-36.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-40.c scan-assembler-not %[re]bp
FAIL: gcc.target/i386/pieces-memset-9.c scan-assembler-not %[re]bp

The problem is that the tests assume -mno-stackrealign while 32-bit
Solaris/x86 defaults to -mstackrealign.

Fixed by explicitly specifying -mno-stackrealign.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pieces-memcpy-7.c (dg-additional-options): Add
-mno-stackrealign.
* gcc.target/i386/pieces-memcpy-8.c: Likewise.
* gcc.target/i386/pieces-memcpy-9.c: Likewise.
* gcc.target/i386/pieces-memset-36.c: Likewise.
* gcc.target/i386/pieces-memset-40.c: Likewise.
* gcc.target/i386/pieces-memset-9.c: Likewise.

# HG changeset patch
# Parent  ca1b8d9f5c6a848755e05983218d627eb8e5b5fa
testsuite: i386: Fix gcc.target/i386/pieces-memcpy-7.c etc. on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/pieces-memcpy-7.c b/gcc/testsuite/gcc.target/i386/pieces-memcpy-7.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memcpy-7.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memcpy-7.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mno-avx -msse2 -mtune=generic" } */
-/* Cope with --enable-frame-pointer.  */
-/* { dg-additional-options "-fomit-frame-pointer" } */
+/* Cope with --enable-frame-pointer, Solaris/x86 -mstackrealign default.  */
+/* { dg-additional-options "-fomit-frame-pointer -mno-stackrealign" } */
 
 void
 foo (int a1, int a2, int a3, int a4, int a5, int a6, char *dst, char *src)
diff --git a/gcc/testsuite/gcc.target/i386/pieces-memcpy-8.c b/gcc/testsuite/gcc.target/i386/pieces-memcpy-8.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memcpy-8.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memcpy-8.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mno-avx2 -mavx -mtune=generic" } */
-/* Cope with --enable-frame-pointer.  */
-/* { dg-additional-options "-fomit-frame-pointer" } */
+/* Cope with --enable-frame-pointer, Solaris/x86 -mstackrealign default.  */
+/* { dg-additional-options "-fomit-frame-pointer -mno-stackrealign" } */
 
 void
 foo (int a1, int a2, int a3, int a4, int a5, int a6, char *dst, char *src)
diff --git a/gcc/testsuite/gcc.target/i386/pieces-memcpy-9.c b/gcc/testsuite/gcc.target/i386/pieces-memcpy-9.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memcpy-9.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memcpy-9.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mavx512f -mtune=generic" } */
-/* Cope with --enable-frame-pointer.  */
-/* { dg-additional-options "-fomit-frame-pointer" } */
+/* Cope with --enable-frame-pointer, Solaris/x86 -mstackrealign default.  */
+/* { dg-additional-options "-fomit-frame-pointer -mno-stackrealign" } */
 
 void
 foo (int a1, int a2, int a3, int a4, int a5, int a6, char *dst, char *src)
diff --git a/gcc/testsuite/gcc.target/i386/pieces-memset-36.c b/gcc/testsuite/gcc.target/i386/pieces-memset-36.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memset-36.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memset-36.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mno-avx512f -mavx2 -mtune=generic" } */
-/* Cope with --enable-frame-pointer.  */
-/* { dg-additional-options "-fomit-frame-pointer" } */
+/* Cope with --enable-frame-pointer, Solaris/x86 -mstackrealign default.  */
+/* { dg-additional-options "-fomit-frame-pointer -mno-stackrealign" } */
 
 extern char *dst;
 
diff --git a/gcc/testsuite/gcc.target/i386/pieces-memset-40.c b/gcc/testsuite/gcc.target/i386/pieces-memset-40.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memset-40.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memset-40.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mno-avx512f -mavx2 -mtune=sandybridge" } */
-/* Cope with --enable-frame-pointer.  */
-/* { dg-additional-options "-fomit-frame-pointer" } */
+/* Cope with --enable-frame-pointer, Solaris/x86 -mstackrealign default.  */
+/* { dg-additional-options "-fomit-frame-pointer -mno-stackrealign" } */
 
 extern char *dst;
 
diff --git a/gcc/testsuite/gcc.target/i386/pieces-memset-9.c b/gcc/testsuite/gcc.target/i386/pieces-memset-9.c
--- a/gcc/testsuite/gcc.target/i386/pieces-memset-9.c
+++ b/gcc/testsuite/gcc.target/i386/pieces-memset-9.c
@@ -1,7 +1,7 @@
 /* { dg-do

[COMMITTED] testsuite: i386: Fix gcc.target/i386/apx-ndd-cmov.c on Solaris/x86

2024-02-02 Thread Rainer Orth
gcc.target/i386/apx-ndd-cmov.c FAILs on 64-bit Solaris/x86 with the
native assembler:

FAIL: gcc.target/i386/apx-ndd-cmov.c scan-assembler-times cmove[^\\n\\r]*, %eax 
1
FAIL: gcc.target/i386/apx-ndd-cmov.c scan-assembler-times cmovge[^\\n\\r]*, 
%eax 1

The gas vs. as difference is

-   cmove   c+4(%rip), %esi, %eax
+   cmovl.e c+4(%rip), %esi, %eax

-   cmovge  %ecx, %edx, %eax
+   cmovl.ge%ecx, %edx, %eax

This patch accounts for both forms.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-02-01  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/apx-ndd-cmov.c (scan-assembler-times): Allow for
cmovl.e, cmovl.ge.

# HG changeset patch
# Parent  b7b9c1365b7c54f5c0e618608af26512175c
testsuite: i386: Fix gcc.target/i386/apx-ndd-cmov.c on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/apx-ndd-cmov.c b/gcc/testsuite/gcc.target/i386/apx-ndd-cmov.c
--- a/gcc/testsuite/gcc.target/i386/apx-ndd-cmov.c
+++ b/gcc/testsuite/gcc.target/i386/apx-ndd-cmov.c
@@ -1,7 +1,7 @@
 /* { dg-do compile { target { ! ia32 } } } */
 /* { dg-options "-O2 -m64 -mapxf" } */
-/* { dg-final { scan-assembler-times "cmove\[^\n\r]*, %eax" 1 } } */
-/* { dg-final { scan-assembler-times "cmovge\[^\n\r]*, %eax" 1 } } */
+/* { dg-final { scan-assembler-times "cmov(l\.)?e\[^\n\r]*, %eax" 1 } } */
+/* { dg-final { scan-assembler-times "cmov(l\.)?ge\[^\n\r]*, %eax" 1 } } */
 
 unsigned int c[4];
 


Re: [PATCH] c-family: Fix ICE with large column number after restoring a PCH [PR105608]

2024-02-01 Thread Rainer Orth
Hi Lewis,

> On Fri, Jan 26, 2024 at 04:16:54PM -0500, Jason Merrill wrote:
>> On 12/5/23 20:52, Lewis Hyatt wrote:
>> > Hello-
>> > 
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105608
>> > 
>> > There are two related issues here really, a regression since GCC 11 where 
>> > we
>> > can ICE after restoring a PCH, and a deeper issue with bogus locations
>> > assigned to macros that were defined prior to restoring a PCH.  This patch
>> > fixes the ICE regression with a simple change, and I think it's appropriate
>> > for GCC 14 as well as backport to 11, 12, 13. The bad locations (wrong, but
>> > not generally causing an ICE, and mostly affecting only the output of
>> > -Wunused-macros) are not as problematic, and will be harder to fix. I could
>> > take a stab at that for GCC 15. In the meantime the patch adds XFAILed
>> > tests for the wrong locations (as well as passing tests for the regression
>> > fix). Does it look OK please? Bootstrap + regtest all languages on x86-64
>> > Linux. Thanks!
>> 
>> OK for trunk and branches, thanks!
>>
>
> Thanks for the review! That is all taken care of. I have one more request if
> you don't mind please... There have been some further comments on the PR
> indicating that the new xfailed testcase I added is failing in an unexpected
> way on at least one architecture. To recap, the idea here was that
>
> 1) libcpp needs new logic to be able to output correct locations for this
> case. That will be some new code that is suitable for stage 1, not now.
>
> 2) In the meantime, we fixed things up enough to avoid an ICE that showed up
> in GCC 11, and added an xfailed testcase to remind about #1.
>
> The problem is that, the reason that libcpp outputs the wrong locations, is
> that it has always used a location from the old line_map instance to index
> into the new line_map instance, and so the exact details of the wrong
> locations it outputs depend on the state of those two line maps, which may
> differ depending on system includes and things like that. So I was hoping to
> make one further one-line change to libcpp, not yet to output correct
> locations, but at least to output one which is the same always and doesn't
> depend on random things. This would assign all restored macros to a
> consistent location, one line following the #include that triggered the PCH
> process. I think this probably shouldn't be backported but it would be nice
> to get into GCC 14, while nothing critical, at least it would avoid the new
> test failure that's being reported. But more generally, I think using a
> location from a totally different line map is dangerous and could have worse
> consequences that haven't been seen yet. Does it look OK please? Thanks!

FWIW, I've tested this (the initial) version of this patch on
sparc-sun-solaris2.11 (PASSes as before) and i386-pc-solaris2.11 (PASSes
now unlike before).

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: Unreviewed patches

2024-02-01 Thread Rainer Orth
Hi Uros,

> On Wed, Jan 31, 2024 at 3:04 PM Rainer Orth  
> wrote:
>>
>> Three patches have remained unreviewed for a week or more:
>>
>> c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as
>> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643434.html
>>
>> This one may even be obvious.

I do claim that now and have installed the patch.

>> testsuite: i386: Fix gcc.target/i386/pr70321.c on 32-bit Solaris/x86
>> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643771.html
>>
>> testsuite: i386: Fix gcc.target/i386/avx512vl-stv-rotatedi-1.c on
>> 32-bit Solaris/x86
>> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643774.html
>>
>> Those two require an x86 maintainer.
>
> OK for x86 patches, I'd say that these two fall under Solaris
> maintainership (if not obvious, after all).

I've always been careful when touching files that affect non-Solaris
targets, in case a maintainer sees a better solution or finds fault with
mine.

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[COMMITTED] Link shared libasan with -z now on Solaris

2024-02-01 Thread Rainer Orth
g++.dg/asan/default-options-1.C FAILs on Solaris/SPARC and x86:

FAIL: g++.dg/asan/default-options-1.C   -O0  execution test
FAIL: g++.dg/asan/default-options-1.C   -O1  execution test
FAIL: g++.dg/asan/default-options-1.C   -O2  execution test
FAIL: g++.dg/asan/default-options-1.C   -O2 -flto  execution test
FAIL: g++.dg/asan/default-options-1.C   -O2 -flto -flto-partition=none  
execution test
FAIL: g++.dg/asan/default-options-1.C   -O3 -g  execution test
FAIL: g++.dg/asan/default-options-1.C   -Os  execution test

The failure is always the same:

AddressSanitizer: CHECK failed: asan_rtl.cpp:397 "((!AsanInitIsRunning() && 
"ASan init calls itself!")) != (0)" (0x0, 0x0) (tid=1)

This happens because libasan makes unportable assumptions about
initialization order that don't hold on Solaris.  The problem has
already been fixed in clang by

[Driver] Link shared asan runtime lib with -z now on Solaris/x86
https://reviews.llvm.org/D156325

where it was way more prevalent.

This patch applies the same fix to gcc.

Tested on i386-pc-solaris2.11 (ld and gld) and sparc-sun-solaris2.11.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-30  Rainer Orth  

gcc:
* config/sol2.h (LIBASAN_EARLY_SPEC): Add -z now unless
-static-libasan.  Add missing whitespace.

# HG changeset patch
# Parent  613872ca097917ba43515f110e45a9ec0fc176fa
Link shared libasan with -z now on Solaris

diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -255,7 +255,7 @@ along with GCC; see the file COPYING3.  
   " %{!shared:libasan_preinit%O%s} \
 %{static-libasan:%{!shared: -Bstatic "\
 LD_WHOLE_ARCHIVE_OPTION " -lasan " LD_NO_WHOLE_ARCHIVE_OPTION \
-"-Bdynamic}}%{!static-libasan:-lasan}"
+" -Bdynamic}}%{!static-libasan:-z now -lasan}"
 
 /* Error out on -fsanitize=thread|leak.  */
 #define LIBTSAN_EARLY_SPEC "\


Unreviewed patches

2024-01-31 Thread Rainer Orth
Three patches have remained unreviewed for a week or more:

c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643434.html

This one may even be obvious.

testsuite: i386: Fix gcc.target/i386/pr70321.c on 32-bit Solaris/x86
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643771.html

testsuite: i386: Fix gcc.target/i386/avx512vl-stv-rotatedi-1.c on 
32-bit Solaris/x86
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643774.html

Those two require an x86 maintainer.

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] testsuite: i386: Fix gcc.target/i386/pr38534-1.c etc. on Solaris/x86

2024-01-31 Thread Rainer Orth
The gcc.target/i386/pr38534-1.c etc. tests FAIL on 32 and 64-bit
Solaris/x86:

FAIL: gcc.target/i386/pr38534-1.c scan-assembler-not push
FAIL: gcc.target/i386/pr38534-2.c scan-assembler-not push
FAIL: gcc.target/i386/pr38534-3.c scan-assembler-not push
FAIL: gcc.target/i386/pr38534-4.c scan-assembler-not push

The tests assume the Linux/x86 default of -fomit-frame-pointer, while
Solaris/x86 defaults to -fno-omit-frame-pointer.

Fixed by specifying -fomit-frame-pointer explicitly.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-30  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pr38534-1.c: Add -fomit-frame-pointer to
dg-options.
* gcc.target/i386/pr38534-2.c: Likewise.
* gcc.target/i386/pr38534-3.c: Likewise.
* gcc.target/i386/pr38534-4.c: Likewise.

# HG changeset patch
# Parent  002cd7277f8ae2677784c606659300d27e7342a4
testsuite: i386: Fix gcc.target/i386/pr38534-1.c etc. on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/pr38534-1.c b/gcc/testsuite/gcc.target/i386/pr38534-1.c
--- a/gcc/testsuite/gcc.target/i386/pr38534-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr38534-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 #define ARRAY_SIZE 256
 
diff --git a/gcc/testsuite/gcc.target/i386/pr38534-2.c b/gcc/testsuite/gcc.target/i386/pr38534-2.c
--- a/gcc/testsuite/gcc.target/i386/pr38534-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr38534-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 extern void bar (void) __attribute__ ((no_callee_saved_registers));
 extern void fn (void) __attribute__ ((noreturn));
diff --git a/gcc/testsuite/gcc.target/i386/pr38534-3.c b/gcc/testsuite/gcc.target/i386/pr38534-3.c
--- a/gcc/testsuite/gcc.target/i386/pr38534-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr38534-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 typedef void (*fn_t) (void) __attribute__ ((no_callee_saved_registers));
 extern fn_t bar;
diff --git a/gcc/testsuite/gcc.target/i386/pr38534-4.c b/gcc/testsuite/gcc.target/i386/pr38534-4.c
--- a/gcc/testsuite/gcc.target/i386/pr38534-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr38534-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 typedef void (*fn_t) (void) __attribute__ ((no_callee_saved_registers));
 extern void fn (void) __attribute__ ((noreturn));


[PATCH] testsuite: i386: Fix gcc.target/i386/no-callee-saved-1.c etc. on Solaris/x86

2024-01-31 Thread Rainer Orth
The gcc.target/i386/no-callee-saved-[12].c tests FAIL on Solaris/x86:

FAIL: gcc.target/i386/no-callee-saved-1.c scan-assembler-not push
FAIL: gcc.target/i386/no-callee-saved-2.c scan-assembler-not push

In both cases, the test expect the Linux/x86 default of
-fomit-frame-pointer, while Solaris/x86 defaults to
-fno-omit-frame-pointer.

So this patch explicitly specifies -fomit-frame-pointer.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-30  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/no-callee-saved-1.c: Add -fomit-frame-pointer to
dg-options.
* gcc.target/i386/no-callee-saved-2.c: Likewise.

# HG changeset patch
# Parent  6cd45b5f542c222744120356f69afdaebd618627
testsuite: i386: Fix gcc.target/i386/no-callee-saved-1.c etc. on Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-1.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-1.c
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-1.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 extern int bar (int)
 #ifndef __x86_64__
diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-2.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-2.c
--- a/gcc/testsuite/gcc.target/i386/no-callee-saved-2.c
+++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move" } */
+/* { dg-options "-O2 -mtune-ctrl=^prologue_using_move,^epilogue_using_move -fomit-frame-pointer" } */
 
 extern int bar (int) __attribute__ ((no_caller_saved_registers))
 #ifndef __x86_64__


[PATCH] testsuite: i386: Disable .eh_frame in gcc.target/i386/auto-init-5.c etc.

2024-01-31 Thread Rainer Orth
The gcc.target/i386/auto-init-5.c and gcc.target/i386/auto-init-6.c
tests FAIL on 64-bit Solaris/x86 with the native assembler:

FAIL: gcc.target/i386/auto-init-5.c scan-assembler-times .long\\t0 14
FAIL: gcc.target/i386/auto-init-6.c scan-assembler-times long\\t0 8

/bin/as doesn't fully support the CFI directives, so the .eh_frame
sections are emitted directly and contain .long.  Since .eh_frame
doesn't matter for those tests, this patch disables its generation in
the first place.

Tested on i386-pc-solaris2.11 (as and gas) and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-30  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/auto-init-5.c: Add
-fno-asynchronous-unwind-tables to dg-options.
* gcc.target/i386/auto-init-6.c: Likewise.

# HG changeset patch
# Parent  5486f016175658d0c7c2de48c893e9fbd68d3493
testsuite: i386: Disable .eh_frame in gcc.target/i386/auto-init-5.c etc.

diff --git a/gcc/testsuite/gcc.target/i386/auto-init-5.c b/gcc/testsuite/gcc.target/i386/auto-init-5.c
--- a/gcc/testsuite/gcc.target/i386/auto-init-5.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-5.c
@@ -1,6 +1,6 @@
 /* Verify zero initialization for complex type automatic variables.  */
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-ftrivial-auto-var-init=zero -fno-asynchronous-unwind-tables" } */
 
 
 _Complex long double result;
diff --git a/gcc/testsuite/gcc.target/i386/auto-init-6.c b/gcc/testsuite/gcc.target/i386/auto-init-6.c
--- a/gcc/testsuite/gcc.target/i386/auto-init-6.c
+++ b/gcc/testsuite/gcc.target/i386/auto-init-6.c
@@ -2,7 +2,7 @@
 /* Note, _Complex long double is initialized to zeroes due to the current
implemenation limitation.  */
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=pattern -march=x86-64 -mtune=generic -msse" } */
+/* { dg-options "-ftrivial-auto-var-init=pattern -march=x86-64 -mtune=generic -msse -fno-asynchronous-unwind-tables" } */
 
 
 _Complex long double result;


[COMMITTED] testsuite: Require ucn in g++.dg/cpp0x/udlit-extended-id-1.C

2024-01-31 Thread Rainer Orth
g++.dg/cpp0x/udlit-extended-id-1.C FAILs on Solaris/SPARC and x86 with
the native assembler:

UNRESOLVED: g++.dg/cpp0x/udlit-extended-id-1.C  -std=c++14 compilation failed 
to produce executable
FAIL: g++.dg/cpp0x/udlit-extended-id-1.C  -std=c++17 (test for excess errors)
UNRESOLVED: g++.dg/cpp0x/udlit-extended-id-1.C  -std=c++17 compilation failed 
to produce executable
FAIL: g++.dg/cpp0x/udlit-extended-id-1.C  -std=c++20 (test for excess errors)
UNRESOLVED: g++.dg/cpp0x/udlit-extended-id-1.C  -std=c++20 compilation failed 
to produce executable

/bin/as doesn't support UCN identifiers:

/usr/ccs/bin/as: "/var/tmp//ccCl_9fa.s", line 4: error: invalid character (0xcf)
/usr/ccs/bin/as: "/var/tmp//ccCl_9fa.s", line 4: error: invalid character (0x80)
/usr/ccs/bin/as: "/var/tmp//ccCl_9fa.s", line 4: error: statement syntax
/usr/ccs/bin/as: "/var/tmp//ccCl_9fa.s", line 4: error: statement syntax
[...]

To avoid this, this patch requires ucn support.

Tested on i386-pc-solaris2.11 (as and gas), sparc-sun-solaris2.11 (as
and gas), and i686-pc-linux-gnu.

Committed to trunk.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-30  Rainer Orth  

gcc/testsuite:
* g++.dg/cpp0x/udlit-extended-id-1.C: Require ucn support.

# HG changeset patch
# Parent  b19044614bf18d15d2ccd8b2b26450678f93acaf
testsuite: Require ucn in g++.dg/cpp0x/udlit-extended-id-1.C

diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C
--- a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C
@@ -1,5 +1,6 @@
 // { dg-do run { target c++11 } }
 // { dg-additional-options "-Wno-error=normalized" }
+// { dg-require-effective-target ucn }
 #include 
 #include 
 using namespace std;


Re: [PATCH] testsuite/vect: Add target checks to refined patterns [PR113558]

2024-01-24 Thread Rainer Orth
Hi Jeff,

> On 1/24/24 07:40, Robin Dapp wrote:
>> Hi,
>> on Solaris/SPARC several vector tests appeared to be regressing.  They
>> were never vectorized but the checks before r14-3612-ge40edf64995769
>> would match regardless if a loop was actually vectorized or not.
>> The refined checks only match a successful vectorization attempt
>> but are run unconditionally.  This patch adds target checks to them.
>> Bootstrapped (unnecessarily) and regtested on x86, aarch64 and
>> power10.  Regtested on riscv and (the previous version that
>> missed vect-reduc-pattern-2a.c) on Solaris/SPARC by Rainer Orth.
>> Is this OK if Rainer's second run is successful?
>> Regards
>>   Robin
>> gcc/testsuite/ChangeLog:
>>  PR testsuite/113558
>>  * gcc.dg/vect/no-scevccp-outer-7.c: Add target check.
>>  * gcc.dg/vect/vect-outer-4c-big-array.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-s16a.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-s8a.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-s8b.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-u16b.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-u8a.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-dot-u8b.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-pattern-1a.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-pattern-1b-big-array.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-pattern-1c-big-array.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-pattern-2a.c: Ditto.
>>  * gcc.dg/vect/vect-reduc-pattern-2b-big-array.c: Ditto.
>>  * gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Ditto.
> Yes, OK if Rainer's run is successful.  If you need to make similiar
> changes to other tests, consider them pre-approved.

sparc-sun-solaris2.11 testing just completed successfully.

Thanks.
Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


[PATCH] testsuite: i386: Don't restrict gcc.dg/vect/vect-simd-clone-16c.c etc. to it686 [PR113556]

2024-01-24 Thread Rainer Orth
A couple of gcc.dg/vect/vect-simd-clone-1*.c tests FAIL on 32-bit
Solaris/x86 since 20230222:

FAIL: gcc.dg/vect/vect-simd-clone-16c.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-16d.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-17c.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-17d.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-18c.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2
FAIL: gcc.dg/vect/vect-simd-clone-18d.c scan-tree-dump-times vect "[nr] 
[^n]* = foo.simdclone" 2

The problem is that the 32-bit Solaris/x86 triple still uses i386,
although gcc defaults to -mpentium4.  However, the tests only handle
x86_64* and i686*, although the tests don't seem to require some
specific ISA extension not covered by vect_simd_clones.

To fix this, the tests now allow generic i?86.  At the same time, I've
removed the wildcards from x86_64* and i686* since DejaGnu uses the
canonical forms.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-24  Rainer Orth  

gcc/testsuite:
PR target/113556
* gcc.dg/vect/vect-simd-clone-16c.c: Don't wildcard x86_64 in
target specs.  Allow any i?86 target instead of i686 only.
* gcc.dg/vect/vect-simd-clone-16d.c: Likewise.
* gcc.dg/vect/vect-simd-clone-17c.c: Likewise.
* gcc.dg/vect/vect-simd-clone-17d.c: Likewise.
* gcc.dg/vect/vect-simd-clone-18c.c: Likewise.
* gcc.dg/vect/vect-simd-clone-18d.c: Likewise.

# HG changeset patch
# Parent  fdb3dfc0639b142e4a092ef5f9c68954d3e5bf74
testsuite: i386: Don't restrict gcc.dg/vect/vect-simd-clone-16c.c etc. to it686 [PR113556]

diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16c.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16c.c
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16c.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16c.c
@@ -7,11 +7,11 @@
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
Some targets use another call for the epilogue loops.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { x86_64*-*-* || { i686*-*-* || aarch64*-*-* } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { x86_64-*-* || { i?86-*-* || aarch64*-*-* } } } } } } */
 /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { aarch64*-*-* } } } } */
 
 /* x86_64 fails to use in-branch clones for TYPE=short.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 0 "vect" { target x86_64*-*-* i686*-*-* } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 0 "vect" { target x86_64-*-* i?86-*-* } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16d.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16d.c
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16d.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16d.c
@@ -7,11 +7,11 @@
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
Some targets use another call for the epilogue loops.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { x86_64*-*-* || { i686*-*-* || aarch64*-*-* } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { x86_64-*-* || { i?86-*-* || aarch64*-*-* } } } } } } */
 /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { aarch64*-*-* } } } } */
 
 /* x86_64 fails to use in-branch clones for TYPE=char.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 0 "vect" { target x86_64*-*-* i686*-*-* } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 0 "vect" { target x86_64-*-* i?86-*-* } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17c.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17c.c
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17c.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17c.c
@@ -7,11 +7,11 @@
  

[PATCH] testsuite: i386: Fix gcc.target/i386/avx512vl-stv-rotatedi-1.c on 32-bit Solaris/x86

2024-01-24 Thread Rainer Orth
gcc.target/i386/avx512vl-stv-rotatedi-1.c FAILs on 32-bit Solaris/x86
since its introduction in

commit 4814b63c3c2326cb5d7baa63882da60ac011bd97
Author: Roger Sayle 
Date:   Mon Jul 10 09:04:29 2023 +0100

i386: Add AVX512 support for STV of SI/DImode rotation by constant.

FAIL: gcc.target/i386/avx512vl-stv-rotatedi-1.c scan-assembler-times vpro[lr]q 
29

While the test depends on -mstv, 32-bit Solaris/x86 defaults to
-mstackrealign which is incompatible.

The patch thus specifies -mstv -mno-stackrealign explicitly.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-23  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/avx512vl-stv-rotatedi-1.c: Add -mstv
-mno-stackrealign to dg-options.

# HG changeset patch
# Parent  b787665f90dfbd5be1b00d411675d6fd896f7a9a
testsuite: i386: Fix gcc.target/i386/avx512vl-stv-rotatedi-1.c on 32-bit Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-stv-rotatedi-1.c b/gcc/testsuite/gcc.target/i386/avx512vl-stv-rotatedi-1.c
--- a/gcc/testsuite/gcc.target/i386/avx512vl-stv-rotatedi-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-stv-rotatedi-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target ia32 } } */
-/* { dg-options "-O2 -mavx512vl" } */
+/* { dg-options "-O2 -mavx512vl -mstv -mno-stackrealign" } */
 
 unsigned long long rot1(unsigned long long x) { return (x>>1) | (x<<63); }
 unsigned long long rot2(unsigned long long x) { return (x>>2) | (x<<62); }


[PATCH] testsuite: i386: Fix gcc.target/i386/pr80833-1.c on 32-bit Solaris/x86

2024-01-24 Thread Rainer Orth
gcc.target/i386/pr80833-1.c FAILs on 32-bit Solaris/x86 since 20220609:

FAIL: gcc.target/i386/pr80833-1.c scan-assembler pextrd

Unlike e.g. Linux/i686, 32-bit Solaris/x86 defaults to -mstackrealign,
so this patch overrides that to match.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-23  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pr80833-1.c: Add -mno-stackrealign to dg-options.

# HG changeset patch
# Parent  0f0cde35c23eb9b92159347bfc0ae5f075be65b3
testsuite: i386: Fix gcc.target/i386/pr80833-1.c on 32-bit Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/pr80833-1.c b/gcc/testsuite/gcc.target/i386/pr80833-1.c
--- a/gcc/testsuite/gcc.target/i386/pr80833-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr80833-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -msse4.1 -mtune=intel -mregparm=2" } */
+/* { dg-options "-O2 -msse4.1 -mtune=intel -mregparm=2 -mno-stackrealign" } */
 /* { dg-require-effective-target ia32 } */
 
 long long test (long long a)


[PATCH] testsuite: i386: Fix gcc.target/i386/pr70321.c on 32-bit Solaris/x86

2024-01-24 Thread Rainer Orth
gcc.target/i386/pr70321.c FAILs on 32-bit Solaris/x86 since its
introduction in

commit 43201f2c2173894bf7c423cad6da1c21567e06c0
Author: Roger Sayle 
Date:   Mon May 30 21:20:09 2022 +0100

PR target/70321: Split double word equality/inequality after STV on x86.

FAIL: gcc.target/i386/pr70321.c scan-assembler-times mov 1

The failure happens because 32-bit Solaris/x86 defaults to
-fno-omit-frame-pointer.

Fixed by specifying -fomit-frame-pointer explicitly.

Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.

Ok for trunk?

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-23  Rainer Orth  

gcc/testsuite:
* gcc.target/i386/pr70321.c: Add -fomit-frame-pointer to
dg-options.

# HG changeset patch
# Parent  229bf3d228cb30f17ea645f6f4b2e8f48d2cfa75
testsuite: i386: Fix gcc.target/i386/pr70321.c on 32-bit Solaris/x86

diff --git a/gcc/testsuite/gcc.target/i386/pr70321.c b/gcc/testsuite/gcc.target/i386/pr70321.c
--- a/gcc/testsuite/gcc.target/i386/pr70321.c
+++ b/gcc/testsuite/gcc.target/i386/pr70321.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target ia32 } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
 
 void foo (long long ixi)
 {


[PATCH] c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as

2024-01-19 Thread Rainer Orth
The new g++.dg/ext/attr-section2*.C tests FAIL on Solaris/SPARC with the
native assembler:

+FAIL: g++.dg/ext/attr-section2.C  -std=c++14  scan-assembler .(section|csect)[ 
t]+.foo
+FAIL: g++.dg/ext/attr-section2.C  -std=c++17  scan-assembler .(section|csect)[ 
t]+.foo
+FAIL: g++.dg/ext/attr-section2.C  -std=c++20  scan-assembler .(section|csect)[ 
t]+.foo

The problem is that the SPARC assembler requires the section name to be
double-quoted, like

.section".foo%_Z3varIiE",#alloc,#write,#progbits

This patch allows for that.  At the same time, it quotes literal dots in
the REs.

Tested on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as
and gas).

Ok for trunk?

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


2024-01-18  Rainer Orth  

gcc/testsuite:
* g++.dg/ext/attr-section2.C (scan-assembler): Quote dots.  Allow
for double-quoted section name.
* g++.dg/ext/attr-section2a.C: Likewise.
* g++.dg/ext/attr-section2b.C: Likewise.

# HG changeset patch
# Parent  7d0c57f448dfceb02583a770e09fa7907720ba7e
c++: Fix g++.dg/ext/attr-section2.C etc. with Solaris/SPARC as

diff --git a/gcc/testsuite/g++.dg/ext/attr-section2.C b/gcc/testsuite/g++.dg/ext/attr-section2.C
--- a/gcc/testsuite/g++.dg/ext/attr-section2.C
+++ b/gcc/testsuite/g++.dg/ext/attr-section2.C
@@ -6,4 +6,4 @@ template
 
 template int var;
 
-// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } }
+// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } }
diff --git a/gcc/testsuite/g++.dg/ext/attr-section2a.C b/gcc/testsuite/g++.dg/ext/attr-section2a.C
--- a/gcc/testsuite/g++.dg/ext/attr-section2a.C
+++ b/gcc/testsuite/g++.dg/ext/attr-section2a.C
@@ -11,4 +11,4 @@ int A::var = 42;
 
 template struct A;
 
-// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } }
+// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } }
diff --git a/gcc/testsuite/g++.dg/ext/attr-section2b.C b/gcc/testsuite/g++.dg/ext/attr-section2b.C
--- a/gcc/testsuite/g++.dg/ext/attr-section2b.C
+++ b/gcc/testsuite/g++.dg/ext/attr-section2b.C
@@ -9,4 +9,4 @@ int* fun() {
 
 template int* fun();
 
-// { dg-final { scan-assembler {.(section|csect)[ \t]+.foo} } }
+// { dg-final { scan-assembler {\.(section|csect)[ \t]+"?\.foo} } }


Re: [PATCH] libstdc++: Update baseline symbols for riscv64-linux

2024-01-18 Thread Rainer Orth
Andreas Schwab  writes:

>   * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.

Speaking of baselines: is this a good time to update them for other
targets, too, or should we better wait a little longer?

Thanks.
Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] rust_debug: Cast size_t values to unsigned long before printing.

2024-01-18 Thread Rainer Orth
Hi Arthur,

> Yes, I was talking about this on IRC the other day - if we do run in a
> situation where we have more than UINT32_MAX procedural macros in memory 
> we have big issues. These debug prints will probably end up getting removed
> soon as they clutter the output a lot for little information.

makes sense, especially if they break the build once in a while ;-)

> I don't mind doing it the right way for our regular prints, but we have not
> been using PRIu64 in our codebase so far, so I'd rather change all those
> incriminating format specifiers at once later down the line - this patch
> was pushed so that 32bit targets could bootstrap the Rust frontend for now.

Makes sense: using different styles throughout the codebase only creates
confusion.

On a related issue: didn't you have some 32-bit host in your CI?  I
remember having similar issues in the past which could easily be avoided
in advance this way.

Thanks.
Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [COMMITTED] rust_debug: Cast size_t values to unsigned long before printing.

2024-01-18 Thread Rainer Orth
Arthur Cohen  writes:

> Using %lu to format size_t values breaks 32 bit targets, and %zu is not
> supported by one of the hosts GCC aims to support - HPUX

But we do have uses of %zu in gcc/rust already!

> diff --git a/gcc/rust/expand/rust-proc-macro.cc 
> b/gcc/rust/expand/rust-proc-macro.cc
> index e8618485b71..09680733e98 100644
> --- a/gcc/rust/expand/rust-proc-macro.cc
> +++ b/gcc/rust/expand/rust-proc-macro.cc
> @@ -171,7 +171,7 @@ load_macros (std::string path)
>if (array == nullptr)
>  return {};
>  
> -  rust_debug ("Found %lu procedural macros", array->length);
> +  rust_debug ("Found %lu procedural macros", (unsigned long) array->length);

Not the best way either: array->length is std::uint64_t, so the format
should use

... %" PRIu64 " procedural...

instead.

I've attached my patch to PR rust/113461.

Rainer

-- 
-----
Rainer Orth, Center for Biotechnology, Bielefeld University


  1   2   3   4   5   6   7   8   9   10   >