This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] i386: Update naked-1.c for PIC
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Uros Bizjak <ubizjak at gmail dot com>
- Date: Mon, 31 Jul 2017 15:48:18 -0700
- Subject: [PATCH] i386: Update naked-1.c for PIC
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
For ia32 targets, -fPIC may generate
call __x86.get_pc_thunk.ax
...
__x86.get_pc_thunk.ax:
movl (%esp), %eax
ret
We should check "ret" only for non-PIC or non-ia32 targets.
OK for trunk?
H.J.
---
* gcc.target/i386/naked-1.c: Check "ret" only for non-PIC or
non-ia32 targets.
---
gcc/testsuite/gcc.target/i386/naked-1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.target/i386/naked-1.c b/gcc/testsuite/gcc.target/i386/naked-1.c
index 440dbe9ee7a..dda354371ba 100644
--- a/gcc/testsuite/gcc.target/i386/naked-1.c
+++ b/gcc/testsuite/gcc.target/i386/naked-1.c
@@ -11,4 +11,4 @@ foo (void)
}
/* { dg-final { scan-assembler "# naked" } } */
/* { dg-final { scan-assembler "ud2" } } */
-/* { dg-final { scan-assembler-not "ret" } } */
+/* { dg-final { scan-assembler-not "ret" { target { nonpic || { ! ia32 } } } } } */
--
2.13.3