https://gcc.gnu.org/g:0a036f75baa7d9de65e8a4fd569b236099b739ef
commit 0a036f75baa7d9de65e8a4fd569b236099b739ef Author: Alexandre Oliva <[email protected]> Date: Thu Nov 5 01:18:30 2026 -0300 testsuite: x86: add -fno-pie to more tests A number of tests fail on i686-pc-linux-gnu and/or x86_64-linux-gnu with --enable-default-pie. Adjust them so that they get the expected code sequences, avoid linker warnings, etc. In line with existing practice, I've added -fno-pie or -no-pie unconditionally where needed to get the expected results. g++.dg/template/friend88.C needs -fno-pie to avoid the comdat function used to set up the PIC register on x86. g++.target/i386/mv*.C need -fno-pie to avoid @PLT in the call patterns. g++.target/i386/pr116896-1.C and gcc.target/i386/pr116896.c use conditional moves to avoid duplicating the PIE epilogue, so we don't get the expected patterns without -fno-pie. gcc.dg/ipa/pr122458.c and gcc.dg/lto/toplevel-extended-asm-1_0.c use function addresses as input operands for top-level asms, which cannot satisfy the ":" constraints, so add -fno-pie. gcc.target/i386/pr94913-2.c used to handle PIC variations, but tolerating duplication of the epilogue or not in the PIC cases is not worth the trouble, so force PIE off. gcc.dg/20021014-1.c, gcc.dg/aru-2.c, gcc.dg/nest.c, gcc.dg/pr32450.c, and gcc.dg/pr43643.c already have -fno-pic, but without -no-pie, the linker complains about DT_TEXTREL in PIE. gcc.target/i386/no-callee-saved-19c.c already has -fno-pic, but the expected code for main gets different offsets depending on whether or not the default tuning prefers accumulating outgoing args. Other tests expect specific assembly instructions that vary when generating PIE. for gcc/testsuite/ChangeLog * g++.dg/template/friend88.C: Compile with -fno-pie. * g++.target/i386/mv-symbols1.C: Likewise. * g++.target/i386/mv-symbols3.C: Likewise. * g++.target/i386/mv-symbols4.C: Likewise. * g++.target/i386/mv-symbols5.C: Likewise. * g++.target/i386/mvc-symbols1.C: Likewise. * g++.target/i386/mvc-symbols3.C: Likewise. * g++.target/i386/pr116896-1.C: Likewise. * gcc.target/i386/pr116896.c: Likewise. * gcc.dg/ipa/pr122458.c: Likewise. * gcc.dg/lto/toplevel-extended-asm-1_0.c: Likewise. * gcc.target/i386/avx512fp16-13.c: Likewise. * gcc.target/i386/builtin-memmove-12.c: Likewise. * gcc.target/i386/memset-pr70308-1b.c: Likewise. * gcc.target/i386/pr122343-1a.c: Likewise. * gcc.target/i386/pr122343-1b.c: Likewise. * gcc.target/i386/pr122343-2a.c: Likewise. * gcc.target/i386/pr122343-2b.c: Likewise. * gcc.target/i386/pr122343-3.c: Likewise. * gcc.target/i386/pr122343-4a.c: Likewise. * gcc.target/i386/pr122343-4b.c: Likewise. * gcc.target/i386/pr122343-5a.c: Likewise. * gcc.target/i386/pr122343-5b.c: Likewise. * gcc.target/i386/pr122343-6a.c: Likewise. * gcc.target/i386/pr122343-6b.c: Likewise. * gcc.target/i386/pr122343-7.c: Likewise. * gcc.target/i386/pr125355-2.c: Likewise. * gcc.target/i386/pr125355.c: Likewise. * gcc.target/i386/pr127897-3.c: Likewise. * gcc.target/i386/pr92080-15.c: Likewise. * gcc.target/i386/pr92080-16.c: Likewise. * gcc.target/i386/pr92080-18.c: Likewise. * gcc.target/i386/pr92080-5.c: Likewise. * gcc.target/i386/pr92080-8.c: Likewise. * gcc.target/i386/pr92080-9.c: Likewise. * gcc.target/i386/pr94913-2.c: Likewise. * gcc.dg/20021014-1.c: Link with -no-pie. * gcc.dg/aru-2.c: Likewise. * gcc.dg/nest.c: Likewise. * gcc.dg/pr32450.c: Likewise. * gcc.dg/pr43643.c: Likewise. * gcc.target/i386/no-callee-saved-19c.c: Add -mno-accumulate-outgoing-args. Diff: --- gcc/testsuite/g++.dg/template/friend88.C | 1 + gcc/testsuite/g++.target/i386/mv-symbols1.C | 2 +- gcc/testsuite/g++.target/i386/mv-symbols3.C | 2 +- gcc/testsuite/g++.target/i386/mv-symbols4.C | 2 +- gcc/testsuite/g++.target/i386/mv-symbols5.C | 2 +- gcc/testsuite/g++.target/i386/mvc-symbols1.C | 2 +- gcc/testsuite/g++.target/i386/mvc-symbols3.C | 2 +- gcc/testsuite/g++.target/i386/pr116896-1.C | 2 +- gcc/testsuite/gcc.dg/20021014-1.c | 2 +- gcc/testsuite/gcc.dg/aru-2.c | 2 +- gcc/testsuite/gcc.dg/ipa/pr122458.c | 2 +- gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c | 2 +- gcc/testsuite/gcc.dg/nest.c | 2 +- gcc/testsuite/gcc.dg/pr32450.c | 2 +- gcc/testsuite/gcc.dg/pr43643.c | 2 +- gcc/testsuite/gcc.target/i386/avx512fp16-13.c | 2 +- gcc/testsuite/gcc.target/i386/builtin-memmove-12.c | 2 +- gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c | 2 +- gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c | 2 +- gcc/testsuite/gcc.target/i386/pr116896.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-1a.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-1b.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-2a.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-2b.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-3.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-4a.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-4b.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-5a.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-5b.c | 2 +- gcc/testsuite/gcc.target/i386/pr122343-6a.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-6b.c | 1 + gcc/testsuite/gcc.target/i386/pr122343-7.c | 1 + gcc/testsuite/gcc.target/i386/pr125355-2.c | 2 +- gcc/testsuite/gcc.target/i386/pr125355.c | 2 +- gcc/testsuite/gcc.target/i386/pr127897-3.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-15.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-16.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-18.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-5.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-8.c | 2 +- gcc/testsuite/gcc.target/i386/pr92080-9.c | 2 +- gcc/testsuite/gcc.target/i386/pr94913-2.c | 10 +++++----- 42 files changed, 46 insertions(+), 38 deletions(-) diff --git a/gcc/testsuite/g++.dg/template/friend88.C b/gcc/testsuite/g++.dg/template/friend88.C index 73d3d525900a..d26b2e3531dc 100644 --- a/gcc/testsuite/g++.dg/template/friend88.C +++ b/gcc/testsuite/g++.dg/template/friend88.C @@ -1,5 +1,6 @@ // PR c++/122819 // { dg-do compile { target c++11 } } +// { dg-additional-options "-fno-pie" } template <typename T> struct basic_streambuf; using streambuf = basic_streambuf<char>; diff --git a/gcc/testsuite/g++.target/i386/mv-symbols1.C b/gcc/testsuite/g++.target/i386/mv-symbols1.C index 3163f03ddd8a..93d5260c6633 100644 --- a/gcc/testsuite/g++.target/i386/mv-symbols1.C +++ b/gcc/testsuite/g++.target/i386/mv-symbols1.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target("default"))) int foo () diff --git a/gcc/testsuite/g++.target/i386/mv-symbols3.C b/gcc/testsuite/g++.target/i386/mv-symbols3.C index 67b273511432..9420fb393037 100644 --- a/gcc/testsuite/g++.target/i386/mv-symbols3.C +++ b/gcc/testsuite/g++.target/i386/mv-symbols3.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target("default"))) int foo (); diff --git a/gcc/testsuite/g++.target/i386/mv-symbols4.C b/gcc/testsuite/g++.target/i386/mv-symbols4.C index c82db70da354..aff1a511e9f2 100644 --- a/gcc/testsuite/g++.target/i386/mv-symbols4.C +++ b/gcc/testsuite/g++.target/i386/mv-symbols4.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target("default"))) int foo () diff --git a/gcc/testsuite/g++.target/i386/mv-symbols5.C b/gcc/testsuite/g++.target/i386/mv-symbols5.C index 7792f113f229..25fb5980b03e 100644 --- a/gcc/testsuite/g++.target/i386/mv-symbols5.C +++ b/gcc/testsuite/g++.target/i386/mv-symbols5.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target("default"))) int foo (); diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols1.C b/gcc/testsuite/g++.target/i386/mvc-symbols1.C index ea8c434c353e..0194d62ed3cc 100644 --- a/gcc/testsuite/g++.target/i386/mvc-symbols1.C +++ b/gcc/testsuite/g++.target/i386/mvc-symbols1.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target_clones("default", "arch=slm", "sse4.2"))) int foo () diff --git a/gcc/testsuite/g++.target/i386/mvc-symbols3.C b/gcc/testsuite/g++.target/i386/mvc-symbols3.C index 33927071028d..93728b77ba08 100644 --- a/gcc/testsuite/g++.target/i386/mvc-symbols3.C +++ b/gcc/testsuite/g++.target/i386/mvc-symbols3.C @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-ifunc "" } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fno-pie" } */ __attribute__((target_clones("default", "arch=slm", "sse4.2"))) int foo (); diff --git a/gcc/testsuite/g++.target/i386/pr116896-1.C b/gcc/testsuite/g++.target/i386/pr116896-1.C index 0732229b93ae..9922a155c0d5 100644 --- a/gcc/testsuite/g++.target/i386/pr116896-1.C +++ b/gcc/testsuite/g++.target/i386/pr116896-1.C @@ -1,6 +1,6 @@ // PR middle-end/116896 // { dg-do compile { target c++20 } } -// { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic" } +// { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic -fno-pie" } // { dg-final { scan-assembler-times "\tjp\t" 1 } } // { dg-final { scan-assembler-not "\tj\[^mp\]\[a-z\]*\t" } } // { dg-final { scan-assembler-times "\tsbb\[bl\]\t\\\$0, " 3 } } diff --git a/gcc/testsuite/gcc.dg/20021014-1.c b/gcc/testsuite/gcc.dg/20021014-1.c index ee5d4597aa37..5429d3e09e36 100644 --- a/gcc/testsuite/gcc.dg/20021014-1.c +++ b/gcc/testsuite/gcc.dg/20021014-1.c @@ -2,7 +2,7 @@ /* { dg-require-profiling "-p" } */ /* { dg-options "-O2 -p" } */ /* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */ -/* { dg-additional-options "-mfentry -fno-pic" { target i?86-*-gnu* x86_64-*-gnu* } } */ +/* { dg-additional-options "-mfentry -fno-pic -no-pie" { target i?86-*-gnu* x86_64-*-gnu* } } */ /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */ /* { dg-message "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/aru-2.c b/gcc/testsuite/gcc.dg/aru-2.c index 61898de032ad..5c2ef73ea5f1 100644 --- a/gcc/testsuite/gcc.dg/aru-2.c +++ b/gcc/testsuite/gcc.dg/aru-2.c @@ -1,7 +1,7 @@ /* { dg-do run } */ /* { dg-require-profiling "-pg" } */ /* { dg-options "-O2 -pg" } */ -/* { dg-additional-options "-mfentry -fno-pic" { target i?86-*-gnu* x86_64-*-gnu* } } */ +/* { dg-additional-options "-mfentry -fno-pic -no-pie" { target i?86-*-gnu* x86_64-*-gnu* } } */ static int __attribute__((noinline)) bar (int x) diff --git a/gcc/testsuite/gcc.dg/ipa/pr122458.c b/gcc/testsuite/gcc.dg/ipa/pr122458.c index afe283b1972e..04f9898d11f1 100644 --- a/gcc/testsuite/gcc.dg/ipa/pr122458.c +++ b/gcc/testsuite/gcc.dg/ipa/pr122458.c @@ -1,6 +1,6 @@ /* PR ipa/122458 */ /* { dg-do link } */ -/* { dg-options "-O2 -no-pie" } */ +/* { dg-options "-O2 -no-pie -fno-pie" } */ /* { dg-xfail-if ".dc.a is a gas extension" { ! gas } } */ static int foo (void) { return 0; }; diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c b/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c index c4e9d536bdb5..a071eabb1a33 100644 --- a/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c @@ -1,5 +1,5 @@ /* { dg-lto-do link } */ -/* { dg-lto-options {{-O2 -flto -flto-partition=1to1 -no-pie} } } */ +/* { dg-lto-options {{-O2 -flto -flto-partition=1to1 -no-pie -fno-pie} } } */ /* { dg-skip-if "SPARC relocation overflow" { sparc*-*-solaris2* && lp64 } } */ /* { dg-skip-if "no-pie unsupported" { *-*-darwin* } "" "" } */ diff --git a/gcc/testsuite/gcc.dg/nest.c b/gcc/testsuite/gcc.dg/nest.c index 2dce65edb88d..14d85bf7c8e1 100644 --- a/gcc/testsuite/gcc.dg/nest.c +++ b/gcc/testsuite/gcc.dg/nest.c @@ -3,7 +3,7 @@ /* { dg-require-profiling "-pg" } */ /* { dg-options "-O2 -pg" } */ /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */ -/* { dg-additional-options "-mfentry -fno-pic" { target i?86-*-gnu* x86_64-*-gnu* } } */ +/* { dg-additional-options "-mfentry -fno-pic -no-pie" { target i?86-*-gnu* x86_64-*-gnu* } } */ /* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/pr32450.c b/gcc/testsuite/gcc.dg/pr32450.c index 0af262f5c673..f66e566f1d55 100644 --- a/gcc/testsuite/gcc.dg/pr32450.c +++ b/gcc/testsuite/gcc.dg/pr32450.c @@ -4,7 +4,7 @@ /* { dg-require-profiling "-pg" } */ /* { dg-options "-O2 -pg" } */ /* { dg-options "-O2 -pg -mtune=core2" { target { i?86-*-* x86_64-*-* } } } */ -/* { dg-additional-options "-mfentry -fno-pic" { target i?86-*-gnu* x86_64-*-gnu* } } */ +/* { dg-additional-options "-mfentry -fno-pic -no-pie" { target i?86-*-gnu* x86_64-*-gnu* } } */ /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/pr43643.c b/gcc/testsuite/gcc.dg/pr43643.c index 41c00c8a2af8..0f2087d63072 100644 --- a/gcc/testsuite/gcc.dg/pr43643.c +++ b/gcc/testsuite/gcc.dg/pr43643.c @@ -4,7 +4,7 @@ /* { dg-require-profiling "-pg" } */ /* { dg-options "-O2 -pg" } */ /* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */ -/* { dg-additional-options "-mfentry -fno-pic" { target i?86-*-gnu* x86_64-*-gnu* } } */ +/* { dg-additional-options "-mfentry -fno-pic -no-pie" { target i?86-*-gnu* x86_64-*-gnu* } } */ extern char *strdup (const char *); diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-13.c b/gcc/testsuite/gcc.target/i386/avx512fp16-13.c index 927d3d7b70c6..e6274fb8c836 100644 --- a/gcc/testsuite/gcc.target/i386/avx512fp16-13.c +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-13.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mtune=generic" } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mtune=generic -fno-pie" } */ #include <immintrin.h> void diff --git a/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c b/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c index 1d1ec5285a5b..1c96ee5b1226 100644 --- a/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c +++ b/gcc/testsuite/gcc.target/i386/builtin-memmove-12.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-skip-if "64b Darwin does not support non-PIC" *-*-darwin* } */ -/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic" } */ +/* { dg-options "-O2 -mno-avx -msse2 -mtune=generic -fno-pie" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target { lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c b/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c index 82d83e9b8733..63f9f7270186 100644 --- a/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c +++ b/gcc/testsuite/gcc.target/i386/memset-pr70308-1b.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-skip-if "64b Darwin does not support non-PIC" *-*-darwin* } */ -/* { dg-options "-O2 -march=x86-64 -fomit-frame-pointer -DUSE_SCANF -fno-stack-protector" } */ +/* { dg-options "-O2 -march=x86-64 -fomit-frame-pointer -DUSE_SCANF -fno-stack-protector -fno-pie" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c b/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c index e7f247b723cb..7a3013d5ba71 100644 --- a/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c +++ b/gcc/testsuite/gcc.target/i386/no-callee-saved-19c.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { *-*-linux* && ia32 } } } */ -/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mtune-ctrl=prologue_using_move,epilogue_using_move" } */ +/* { dg-options "-O2 -fno-pic -mtune=generic -msse2 -mno-avx -mno-mmx -mno-80387 -mno-accumulate-outgoing-args -mtune-ctrl=prologue_using_move,epilogue_using_move" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr116896.c b/gcc/testsuite/gcc.target/i386/pr116896.c index 07b9d2d973e5..4c6a5fe3e736 100644 --- a/gcc/testsuite/gcc.target/i386/pr116896.c +++ b/gcc/testsuite/gcc.target/i386/pr116896.c @@ -1,6 +1,6 @@ /* PR middle-end/116896 */ /* { dg-do compile } */ -/* { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic" } */ +/* { dg-options "-O2 -masm=att -fno-stack-protector -mtune=generic -fno-pie" } */ /* { dg-final { scan-assembler-times "\tjp\t" 2 } } */ /* { dg-final { scan-assembler-not "\tj\[^mp\]\[a-z\]*\t" } } */ /* { dg-final { scan-assembler-times "\tsbb\[bl\]\t\\\$0, " 4 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1a.c b/gcc/testsuite/gcc.target/i386/pr122343-1a.c index 12efa1b6848a..dd6507a77283 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-1a.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-1a.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* { dg-additional-options "-mregparm=1 -fno-pie" { target ia32 } } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1b.c b/gcc/testsuite/gcc.target/i386/pr122343-1b.c index 94801d08b893..030d8bd42dae 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-1b.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-1b.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mtune=generic -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ -/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* { dg-additional-options "-mregparm=1 -fno-pie" { target ia32 } } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2a.c b/gcc/testsuite/gcc.target/i386/pr122343-2a.c index 6683b8e4a399..e6c7ec141ea2 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-2a.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-2a.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-add-options check_function_bodies } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target *-*-darwin* } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2b.c b/gcc/testsuite/gcc.target/i386/pr122343-2b.c index 2472f50c8fe6..25de5faa4220 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-2b.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-2b.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target *-*-darwin* } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-3.c b/gcc/testsuite/gcc.target/i386/pr122343-3.c index 7ff957825eb5..51012ac78390 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-3.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-3.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4a.c b/gcc/testsuite/gcc.target/i386/pr122343-4a.c index 2426742b6d2d..86ed6dce90dc 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-4a.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-4a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-options "-O2 -fomit-frame-pointer -fno-pie" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4b.c b/gcc/testsuite/gcc.target/i386/pr122343-4b.c index 45f75b3e484a..b87cb4262ccf 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-4b.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-4b.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5a.c b/gcc/testsuite/gcc.target/i386/pr122343-5a.c index b093ff05d48b..8e894ebc4b10 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-5a.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-5a.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* { dg-additional-options "-mregparm=1 -fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5b.c b/gcc/testsuite/gcc.target/i386/pr122343-5b.c index 8a1a5649f276..69ce42bdf916 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-5b.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-5b.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mtune=generic -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ -/* { dg-additional-options "-mregparm=1" { target ia32 } } */ +/* { dg-additional-options "-mregparm=1 -fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6a.c b/gcc/testsuite/gcc.target/i386/pr122343-6a.c index cdc4e5d2a462..977ea51512ea 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-6a.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-6a.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6b.c b/gcc/testsuite/gcc.target/i386/pr122343-6b.c index dc9adc14a451..9d08766a6d9a 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-6b.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-6b.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr122343-7.c b/gcc/testsuite/gcc.target/i386/pr122343-7.c index 97cee196c036..d76dd5de437e 100644 --- a/gcc/testsuite/gcc.target/i386/pr122343-7.c +++ b/gcc/testsuite/gcc.target/i386/pr122343-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fomit-frame-pointer" } */ +/* { dg-additional-options "-fno-pie" { target ia32 } } */ /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */ /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr125355-2.c b/gcc/testsuite/gcc.target/i386/pr125355-2.c index 719c93c69a7b..dc4bb9fbc45b 100644 --- a/gcc/testsuite/gcc.target/i386/pr125355-2.c +++ b/gcc/testsuite/gcc.target/i386/pr125355-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mtune=generic" } */ +/* { dg-options "-O2 -mtune=generic -fno-pie" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr125355.c b/gcc/testsuite/gcc.target/i386/pr125355.c index 7509852be03f..48e6d8de9183 100644 --- a/gcc/testsuite/gcc.target/i386/pr125355.c +++ b/gcc/testsuite/gcc.target/i386/pr125355.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-Os -mtune=generic" } */ +/* { dg-options "-Os -mtune=generic -fno-pie" } */ /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */ /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr127897-3.c b/gcc/testsuite/gcc.target/i386/pr127897-3.c index 1f3c0bd02741..302ebaf416dd 100644 --- a/gcc/testsuite/gcc.target/i386/pr127897-3.c +++ b/gcc/testsuite/gcc.target/i386/pr127897-3.c @@ -1,6 +1,6 @@ /* PR target/127897 */ /* { dg-do compile } */ -/* { dg-options "-O2 -mavx2 -mno-avx512f" } */ +/* { dg-options "-O2 -mavx2 -mno-avx512f -fno-pie" } */ /* { dg-final { scan-assembler-times "vbroadcastss" 2 } } */ #include <immintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/pr92080-15.c b/gcc/testsuite/gcc.target/i386/pr92080-15.c index fa55d82e48ea..1c116feb58e6 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-15.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-15.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -march=x86-64-v4" } */ +/* { dg-options "-O1 -march=x86-64-v4 -fno-pie" } */ /* { dg-final { scan-assembler-times "vpbroadcastd" 3 } } */ typedef int v4si __attribute__((vector_size(16))); diff --git a/gcc/testsuite/gcc.target/i386/pr92080-16.c b/gcc/testsuite/gcc.target/i386/pr92080-16.c index c8ab084b7143..917563f80c36 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-16.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-16.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -march=x86-64-v4" } */ +/* { dg-options "-O1 -march=x86-64-v4 -fno-pie" } */ /* { dg-final { scan-assembler-times "vpbroadcastd" 1 } } */ typedef int v4si __attribute__((vector_size(16))); diff --git a/gcc/testsuite/gcc.target/i386/pr92080-18.c b/gcc/testsuite/gcc.target/i386/pr92080-18.c index b4ec12e5536e..4c123b84e670 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-18.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-18.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4" } */ +/* { dg-options "-O2 -march=x86-64-v4 -fno-pie" } */ /* { dg-final { scan-assembler-times "vbroadcastsd" 1 } } */ typedef double v2df __attribute__((vector_size(16))); diff --git a/gcc/testsuite/gcc.target/i386/pr92080-5.c b/gcc/testsuite/gcc.target/i386/pr92080-5.c index 380cd337e093..12cae893d083 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-5.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=x86-64-v4" } */ +/* { dg-options "-O2 -march=x86-64-v4 -fno-pie" } */ /* { dg-final { scan-assembler-times "vpbroadcastd" 3 } } */ /* { dg-final { scan-assembler-times "vpbroadcastq" 1 } } */ /* { dg-final { scan-assembler-times "vbroadcastsd" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr92080-8.c b/gcc/testsuite/gcc.target/i386/pr92080-8.c index 7ebb62cea753..d3486e54a052 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-8.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=x86-64-v4 -O2" } */ +/* { dg-options "-march=x86-64-v4 -O2 -fno-pie" } */ /* { dg-final { scan-assembler-times "vpbroadcastd" 1 } } */ /* { dg-final { scan-assembler-times "vpbroadcastq" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr92080-9.c b/gcc/testsuite/gcc.target/i386/pr92080-9.c index f44ab563f545..37db5855754d 100644 --- a/gcc/testsuite/gcc.target/i386/pr92080-9.c +++ b/gcc/testsuite/gcc.target/i386/pr92080-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=x86-64-v4 -O2" } */ +/* { dg-options "-march=x86-64-v4 -O2 -fno-pie" } */ /* { dg-final { scan-assembler-times "vpbroadcastd" 1 } } */ /* { dg-final { scan-assembler-times "vmovdqa\[\\t \]+" 8 } } */ /* { dg-final { scan-assembler-times "vmovdqa64\[\\t \]+" 3 } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr94913-2.c b/gcc/testsuite/gcc.target/i386/pr94913-2.c index 199f3fe7a016..78c74c4ee589 100644 --- a/gcc/testsuite/gcc.target/i386/pr94913-2.c +++ b/gcc/testsuite/gcc.target/i386/pr94913-2.c @@ -1,6 +1,6 @@ /* PR target/94913 */ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fno-pie" } */ void f1 (void); void f2 (void); @@ -21,8 +21,8 @@ void fooi (unsigned long x, unsigned long y) } /* { dg-final { scan-assembler-not "cmp" } } */ -/* On IA32, PIC adds one add per function to compute the PIC register, and +/* On IA32, PIC/PIE adds one add per function to compute the PIC register, and another add to adjust %esp in the epilogue needed to restore the PIC - register. */ -/* { dg-final { scan-assembler-times "add" 3 { target { ! { ia32 && { ! nonpic } } } } } } */ -/* { dg-final { scan-assembler-times "add" 9 { target { ia32 && { ! nonpic } } } } } */ + register, but the epilogue may or may not be duplicated. Avoid this + complexity by disabling PIC/PIE altogether. */ +/* { dg-final { scan-assembler-times "add" 3 } } */
