This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] i386: Update naked-1.c for PIC


On Tue, Aug 1, 2017 at 12:48 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> 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.

I have added -fno-pic to dg-options.

Tested on x86_64-linux-gnu {,-m32} and committed.

Uros.

Index: gcc.target/i386/naked-1.c
===================================================================
--- gcc.target/i386/naked-1.c   (revision 250745)
+++ gcc.target/i386/naked-1.c   (working copy)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O0" } */
+/* { dg-options "-O0 -fno-pic" } */

 /* Verify that __attribute__((naked)) produces a naked function
    that does not use ret to return but traps at the end.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]