testsuite/70230 - fix failures with default SSP\
authorAllan McRae <allan@archlinux.org>
Fri, 28 Jan 2022 17:44:08 +0000 (12:44 -0500)
committerJeff Law <jeffreyalaw@gmail.com>
Fri, 28 Jan 2022 17:45:16 +0000 (12:45 -0500)
Configuring with --enable-default-ssp triggers various testsuite
failures.  These contain asm statements that are not compatible with
-fstack-protector.  Adding -fno-stack-protector to dg-options to
work around this issue.

Tested on x86_64-linux.

PR testsuite/70230
* gcc.dg/asan/use-after-scope-4.c (dg-options): Add
-fno-stack-protector.
* gcc.dg/stack-usage-1.c: Likewise
* gcc.dg/superblock.c: Likewise
* gcc.target/i386/avx-vzeroupper-17.c: Likewise
* gcc.target/i386/cleanup-1.c: Likewise
* gcc.target/i386/cleanup-2.c: Likewise
* gcc.target/i386/interrupt-redzone-1.c: Likewise
* gcc.target/i386/interrupt-redzone-2.c: Likewise
* gcc.target/i386/pr79793-1.c: Likewise
* gcc.target/i386/pr79793-2.c: Likewise
* gcc.target/i386/shrink_wrap_1.c: Likewise
* gcc.target/i386/stack-check-11.c: Likewise
* gcc.target/i386/stack-check-18.c: Likewise
* gcc.target/i386/stack-check-19.c: Likewise
* gcc.target/i386/stackalign/pr88483-1.c: Likewise
* gcc.target/i386/stackalign/pr88483-2.c: Likewise
* gcc.target/i386/sw-1.c: Likewise

17 files changed:
gcc/testsuite/gcc.dg/asan/use-after-scope-4.c
gcc/testsuite/gcc.dg/stack-usage-1.c
gcc/testsuite/gcc.dg/superblock.c
gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c
gcc/testsuite/gcc.target/i386/cleanup-1.c
gcc/testsuite/gcc.target/i386/cleanup-2.c
gcc/testsuite/gcc.target/i386/interrupt-redzone-1.c
gcc/testsuite/gcc.target/i386/interrupt-redzone-2.c
gcc/testsuite/gcc.target/i386/pr79793-1.c
gcc/testsuite/gcc.target/i386/pr79793-2.c
gcc/testsuite/gcc.target/i386/shrink_wrap_1.c
gcc/testsuite/gcc.target/i386/stack-check-11.c
gcc/testsuite/gcc.target/i386/stack-check-18.c
gcc/testsuite/gcc.target/i386/stack-check-19.c
gcc/testsuite/gcc.target/i386/stackalign/pr88483-1.c
gcc/testsuite/gcc.target/i386/stackalign/pr88483-2.c
gcc/testsuite/gcc.target/i386/sw-1.c

index 44dc795..e1486e7 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do run }
+/* { dg-options "-fno-stack-protector" } */
 
 #define FN(NAME) \
 NAME (void) \
index 93cfe7c..1d7d1fe 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fstack-usage" } */
+/* { dg-options "-fstack-usage -fno-stack-protector" } */
 /* nvptx doesn't have a reg allocator, and hence no stack usage data.  */
 /* { dg-skip-if "" { nvptx-*-* } } */
 
index 2b2fa9e..6b4419a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro" } */
+/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro -fno-stack-protector" } */
 /* { dg-require-effective-target scheduling } */
 
 typedef int aligned __attribute__ ((aligned (64)));
index 6dc0dc0..d677e6f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target lp64 } } */
-/* { dg-options "-O2 -mavx -mabi=ms -dp" } */
+/* { dg-options "-O2 -mavx -mabi=ms -dp -fno-stack-protector" } */
 
 typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__));
 
index dcfcc4e..6e7544c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target *-*-linux* *-*-gnu* } } */
-/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2" } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2 -fno-stack-protector" } */
 /* Test complex CFA value expressions.  */
 
 #include <unwind.h>
index 7e60323..a24daba 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run { target { *-*-linux* && { ! ia32 } } } } */
-/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2" } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2 -fno-stack-protector" } */
 /* Test complex CFA value expressions.  */
 
 #include <unwind.h>
index 1009884..0c412db 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mred-zone" } */
+/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mred-zone -fno-stack-protector" } */
 
 void
 __attribute__((interrupt))
index 2577f43..caea996 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mred-zone" } */
+/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mred-zone -fno-stack-protector" } */
 
 void
 __attribute__((interrupt))
index 1cc67a8..102d63a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
-/* { dg-options "-O2 -mgeneral-regs-only -mtune=generic" } */
+/* { dg-options "-O2 -mgeneral-regs-only -mtune=generic -fno-stack-protector" } */
 
 void
  __attribute__ ((interrupt))
index e1e6463..30f22be 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
-/* { dg-options "-O2 -mgeneral-regs-only -mtune=generic" } */
+/* { dg-options "-O2 -mgeneral-regs-only -mtune=generic -fno-stack-protector" } */
 
 typedef unsigned int uword_t __attribute__ ((mode (__word__)));
 
index 94dadd6..4b28667 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */
+/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue -fno-stack-protector" } */
 
 enum machine_mode
 {
index 90ab602..48341ce 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fstack-clash-protection -mtune=generic" } */
+/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fno-stack-protector" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
 
 #include <stdint.h>
index 1cf4bbc..a0aab4a 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */
+/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand -fno-stack-protector" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
 /* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */
 
index bf6af5f..94c75dc 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */
+/* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand -fno-stack-protector" } */
 /* { dg-require-effective-target supports_stack_clash_protection } */
 /* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */
 
index c8bb083..11ecdd5 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mavx2" } */
+/* { dg-options "-O2 -mavx2 -fno-stack-protector" } */
 
 struct B
 {
index e94fa1d..33174fa 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mavx512f" } */
+/* { dg-options "-O2 -mavx512f -fno-stack-protector" } */
 
 struct B
 {
index a9c89fc..b043227 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mtune=generic -fshrink-wrap -fdump-rtl-pro_and_epilogue" } */
+/* { dg-options "-O2 -mtune=generic -fshrink-wrap -fdump-rtl-pro_and_epilogue -fno-stack-protector" } */
 /* { dg-additional-options "-mno-avx" { target ia32 } } */
 /* { dg-skip-if "No shrink-wrapping preformed" { x86_64-*-mingw* } } */