testsuite: Disable -fstack-protector* for some strub tests

Message ID ZXbK8qYENq521KSd@tucnak
State Unresolved
Headers
Series testsuite: Disable -fstack-protector* for some strub tests |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Dec. 11, 2023, 8:40 a.m. UTC
  Hi!

In our distro builds, we test with
RUNTESTFLAGS='--target_board=unix\{,-fstack-protector-strong\}'
because SSP is something we use widely in the distribution.
4 new strub test FAIL with that option though, as can be
seen with a simple
make check-gcc check-g++ RUNTESTFLAGS='--target_board=unix\{,-fstack-protector-strong\} dg.exp=strub-O*'
- in particular, the expand dump
\[(\]call\[^\n\]*strub_leave.*\n\[(\]code_label
regexps see code_labels in there introduced for stack protector.

The following patch fixes it by using -fno-stack-protector for these
explicitly.

Tested on x86_64-linux, ok for trunk?

2023-12-11  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/strub-O2fni.c: Add -fno-stack-protector to dg-options.
	* c-c++-common/strub-O3fni.c: Likewise.
	* c-c++-common/strub-Os.c: Likewise.
	* c-c++-common/strub-Og.c: Likewise. 


	Jakub
  

Comments

Richard Biener Dec. 11, 2023, 8:59 a.m. UTC | #1
On Mon, 11 Dec 2023, Jakub Jelinek wrote:

> Hi!
> 
> In our distro builds, we test with
> RUNTESTFLAGS='--target_board=unix\{,-fstack-protector-strong\}'
> because SSP is something we use widely in the distribution.
> 4 new strub test FAIL with that option though, as can be
> seen with a simple
> make check-gcc check-g++ RUNTESTFLAGS='--target_board=unix\{,-fstack-protector-strong\} dg.exp=strub-O*'
> - in particular, the expand dump
> \[(\]call\[^\n\]*strub_leave.*\n\[(\]code_label
> regexps see code_labels in there introduced for stack protector.
> 
> The following patch fixes it by using -fno-stack-protector for these
> explicitly.
> 
> Tested on x86_64-linux, ok for trunk?

OK.

> 2023-12-11  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* c-c++-common/strub-O2fni.c: Add -fno-stack-protector to dg-options.
> 	* c-c++-common/strub-O3fni.c: Likewise.
> 	* c-c++-common/strub-Os.c: Likewise.
> 	* c-c++-common/strub-Og.c: Likewise. 
> 
> --- gcc/testsuite/c-c++-common/strub-O2fni.c.jj	2023-12-08 08:28:23.689170380 +0100
> +++ gcc/testsuite/c-c++-common/strub-O2fni.c	2023-12-11 09:25:49.100792709 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O2 -fstrub=strict -fdump-rtl-expand -fno-inline" } */
> +/* { dg-options "-O2 -fstrub=strict -fdump-rtl-expand -fno-inline -fno-stack-protector" } */
>  /* { dg-require-effective-target strub } */
>  
>  /* With -fno-inline, none of the strub builtins are inlined.  */
> --- gcc/testsuite/c-c++-common/strub-O3fni.c.jj	2023-12-08 08:28:23.707170125 +0100
> +++ gcc/testsuite/c-c++-common/strub-O3fni.c	2023-12-11 09:25:56.388695362 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O3 -fstrub=strict -fdump-rtl-expand -fno-inline" } */
> +/* { dg-options "-O3 -fstrub=strict -fdump-rtl-expand -fno-inline -fno-stack-protector" } */
>  /* { dg-require-effective-target strub } */
>  
>  /* With -fno-inline, none of the strub builtins are inlined.  */
> --- gcc/testsuite/c-c++-common/strub-Os.c.jj	2023-12-08 08:28:23.707170125 +0100
> +++ gcc/testsuite/c-c++-common/strub-Os.c	2023-12-11 09:26:24.994313267 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-Os -fstrub=strict -fdump-rtl-expand" } */
> +/* { dg-options "-Os -fstrub=strict -fdump-rtl-expand -fno-stack-protector" } */
>  /* { dg-require-effective-target strub } */
>  
>  /* At -Os, without -fno-inline, we fully expand enter, and also update.  The
> --- gcc/testsuite/c-c++-common/strub-Og.c.jj	2023-12-08 08:28:23.707170125 +0100
> +++ gcc/testsuite/c-c++-common/strub-Og.c	2023-12-11 09:26:07.077552587 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-do compile } */
> -/* { dg-options "-Og -fstrub=strict -fdump-rtl-expand" } */
> +/* { dg-options "-Og -fstrub=strict -fdump-rtl-expand -fno-stack-protector" } */
>  /* { dg-require-effective-target strub } */
>  
>  /* At -Og, without -fno-inline, we fully expand enter, but neither update nor
> 
> 	Jakub
> 
>
  

Patch

--- gcc/testsuite/c-c++-common/strub-O2fni.c.jj	2023-12-08 08:28:23.689170380 +0100
+++ gcc/testsuite/c-c++-common/strub-O2fni.c	2023-12-11 09:25:49.100792709 +0100
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fstrub=strict -fdump-rtl-expand -fno-inline" } */
+/* { dg-options "-O2 -fstrub=strict -fdump-rtl-expand -fno-inline -fno-stack-protector" } */
 /* { dg-require-effective-target strub } */
 
 /* With -fno-inline, none of the strub builtins are inlined.  */
--- gcc/testsuite/c-c++-common/strub-O3fni.c.jj	2023-12-08 08:28:23.707170125 +0100
+++ gcc/testsuite/c-c++-common/strub-O3fni.c	2023-12-11 09:25:56.388695362 +0100
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -fstrub=strict -fdump-rtl-expand -fno-inline" } */
+/* { dg-options "-O3 -fstrub=strict -fdump-rtl-expand -fno-inline -fno-stack-protector" } */
 /* { dg-require-effective-target strub } */
 
 /* With -fno-inline, none of the strub builtins are inlined.  */
--- gcc/testsuite/c-c++-common/strub-Os.c.jj	2023-12-08 08:28:23.707170125 +0100
+++ gcc/testsuite/c-c++-common/strub-Os.c	2023-12-11 09:26:24.994313267 +0100
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Os -fstrub=strict -fdump-rtl-expand" } */
+/* { dg-options "-Os -fstrub=strict -fdump-rtl-expand -fno-stack-protector" } */
 /* { dg-require-effective-target strub } */
 
 /* At -Os, without -fno-inline, we fully expand enter, and also update.  The
--- gcc/testsuite/c-c++-common/strub-Og.c.jj	2023-12-08 08:28:23.707170125 +0100
+++ gcc/testsuite/c-c++-common/strub-Og.c	2023-12-11 09:26:07.077552587 +0100
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Og -fstrub=strict -fdump-rtl-expand" } */
+/* { dg-options "-Og -fstrub=strict -fdump-rtl-expand -fno-stack-protector" } */
 /* { dg-require-effective-target strub } */
 
 /* At -Og, without -fno-inline, we fully expand enter, but neither update nor