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