Message ID | EE8250E8-9877-4362-8736-4E7976ABC1B3@gmail.com |
---|---|
State | New |
Headers | show |
On Sat, Nov 15, 2014 at 11:46 AM, FX <fxcoudert@gmail.com> wrote: > Don’t run gcc.target/i386/sibcall-1.c on PIC targets. > > > 2014-11-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> > > PR target/60104 > * gcc.target/i386/sibcall-1.c: Don't run on pic targets. > > > Index: gcc.target/i386/sibcall-1.c > =================================================================== > --- gcc.target/i386/sibcall-1.c (revision 217599) > +++ gcc.target/i386/sibcall-1.c (working copy) > @@ -1,4 +1,4 @@ > -/* { dg-do compile { target ia32 } } */ > +/* { dg-do compile { target { ia32 && nonpic } } } */ > /* { dg-options "-O2" } */ > > extern int (*foo)(int); > This looks wrong. This test should pass for 64-bit or ia32 && nonpic.
> This looks wrong. This test should pass for 64-bit or ia32 && nonpic.
It was Kai’s original testcase, so I don’t want to modify it too much, other than make it skip where it clearly fails.
FX
On Sat, Nov 15, 2014 at 12:22 PM, FX <fxcoudert@gmail.com> wrote: >> This looks wrong. This test should pass for 64-bit or ia32 && nonpic. > > It was Kai’s original testcase, so I don’t want to modify it too much, other than make it skip where it clearly fails. > Original bug report was filed against x86-64: The attached testcase is a greatly reduced interpreter loop, containing a simple load and indirect branch: goto *addresses[*pc++] gcc 4.8.2 (as well as older versions) with -O2 produces the following x86-64 output: movq addresses.1721(,%rax,8), %rax jmp *%rax Since the loaded value is not used after the branch, there's no need to hold it in a register, so the load could be folded into the branch. This would improve code size and instruction count. Add a testcase only for ia32 makes no senses at all. H.J.
Index: gcc.target/i386/sibcall-1.c =================================================================== --- gcc.target/i386/sibcall-1.c (revision 217599) +++ gcc.target/i386/sibcall-1.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile { target ia32 } } */ +/* { dg-do compile { target { ia32 && nonpic } } } */ /* { dg-options "-O2" } */ extern int (*foo)(int);