aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2019-08-16 03:38:49 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2019-08-16 03:38:49 +0000
commit967a322edecf6d8ef8ab58ff7a50cf58c26e7de6 (patch)
treecc70600eb024f8ddd5773eb3f28903ad234557d6
parent1ce521ece9a514dd8c5a3baa6e66bab928fd5e7c (diff)
downloadgcc-967a322edecf6d8ef8ab58ff7a50cf58c26e7de6.zip
gcc-967a322edecf6d8ef8ab58ff7a50cf58c26e7de6.tar.gz
gcc-967a322edecf6d8ef8ab58ff7a50cf58c26e7de6.tar.bz2
i386/asm-4 test: use amd64's natural addressing mode on all OSs
gcc.target/i386/asm-4.c uses amd64's natural PC-relative addressing mode on a single platform, using the 32-bit absolute addressing mode elsewhere. There's no point in giving up amd64's natural addressing mode and insisting on the 32-bit one when we're targeting amd64, and having to make explicit exceptions for systems where that's found not to work for whatever reason. If we just use the best-suited way to take the address of a function behind the compiler's back on each target variant, we're less likely to hit unexpected failures. for gcc/testsuite/ChangeLog * gcc.target/i386/asm-4.c: Use amd64 natural addressing mode on all __LP64__ targets. From-SVN: r274559
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.target/i386/asm-4.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 055ff04..d75c646 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2019-08-16 Alexandre Oliva <oliva@adacore.com>
+ * gcc.target/i386/asm-4.c: Use amd64 natural addressing mode
+ on all __LP64__ targets.
+
* gcc.target/arc/interrupt-6.c: Use __builtin_alloca, require
effective target support for alloca, drop include of alloca.h.
* gcc.target/i386/pr80969-3.c: Likewise.
diff --git a/gcc/testsuite/gcc.target/i386/asm-4.c b/gcc/testsuite/gcc.target/i386/asm-4.c
index b868010..69dd1d3 100644
--- a/gcc/testsuite/gcc.target/i386/asm-4.c
+++ b/gcc/testsuite/gcc.target/i386/asm-4.c
@@ -29,7 +29,7 @@ baz (void)
{
/* Darwin loads 64-bit regions above the 4GB boundary so
we need to use this instead. */
-#if defined (__LP64__) && defined (__MACH__)
+#if defined (__LP64__)
__asm ("leaq foo(%%rip), %0" : "=r" (fn));
#else
__asm ("movl $foo, %k0" : "=r" (fn));