rs6000: Use -mno-pcrel for tests requiring TOC

Message ID 20200224212030.88015-1-wschmidt@linux.ibm.com
State New
Headers show
Series
  • rs6000: Use -mno-pcrel for tests requiring TOC
Related show

Commit Message

Bill Schmidt Feb. 24, 2020, 9:20 p.m.
These two test cases have assembly code that requires a valid TOC.
Make sure that we don't use the PC-relative ABI extensions that
violate this requirement.

Tested and verified on powerpc64le-unknown-linux-gnu.  Is this
okay for trunk?

Thanks,
Bill

2020-02-24  Bill Schmidt  <wschmidt@linux.ibm.com>

        * gcc.target/powerpc/ppc64-abi-1.c: Compile with -mno-pcrel.
        * gcc.target/powerpc/ppc64-abi-2.c: Likewise.
---
 gcc/testsuite/gcc.target/powerpc/ppc64-abi-1.c | 2 +-
 gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Segher Boessenkool Feb. 25, 2020, 10 p.m. | #1
On Mon, Feb 24, 2020 at 03:20:30PM -0600, Bill Schmidt wrote:
> These two test cases have assembly code that requires a valid TOC.

> Make sure that we don't use the PC-relative ABI extensions that

> violate this requirement.

> 

> Tested and verified on powerpc64le-unknown-linux-gnu.  Is this

> okay for trunk?


Okay, thanks!

Should there be a testsuite/gcc.target/powerpc/ppc64-abi-pcrel.c as well?


Segher
Bill Schmidt Feb. 25, 2020, 10:20 p.m. | #2
On 2/25/20 4:00 PM, Segher Boessenkool wrote:
> On Mon, Feb 24, 2020 at 03:20:30PM -0600, Bill Schmidt wrote:

>> These two test cases have assembly code that requires a valid TOC.

>> Make sure that we don't use the PC-relative ABI extensions that

>> violate this requirement.

>>

>> Tested and verified on powerpc64le-unknown-linux-gnu.  Is this

>> okay for trunk?

> Okay, thanks!

>

> Should there be a testsuite/gcc.target/powerpc/ppc64-abi-pcrel.c as well?


I don't think we need anything to replace these particular tests.  They
are testing correct parameter passing, and we have exhaustive testing
for those aspects in the ABI compatibility testsuite (and they don't
change for PC-relative).  We also have a number of tests that were
added specifically for the TOC-removal aspects of PC-relative addressing
when those pieces went in.  It's of course always true that more tests
are better, but I don't think we're losing coverage with this patch.

Thanks,
Bill

>

>

> Segher

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-1.c b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-1.c
index 921c46862e2..731c0d880aa 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do run { target { powerpc*-*-* && lp64 } } } */
 /* { dg-skip-if "" { *-*-darwin* } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mno-pcrel" } */
 
 typedef __builtin_va_list va_list;
 #define va_start(ap, arg) __builtin_va_start (ap, arg)
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c
index eb1df7a2dc9..b490fc3c2fd 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do run { target { { powerpc*-*-linux* && lp64 } && powerpc_altivec_ok } } } */
-/* { dg-options "-O2 -fprofile -mprofile-kernel -maltivec -mabi=altivec" } */
+/* { dg-options "-O2 -fprofile -mprofile-kernel -maltivec -mabi=altivec -mno-pcrel" } */
 #include <stdarg.h>
 #include <signal.h>
 #include <altivec.h>