On Sat, Nov 15, 2014 at 12:29 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Sat, Nov 15, 2014 at 12:22 PM, FX <fxcoud...@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. >
I checked in this to run it on non-x32 targets. H.J. --- Index: ChangeLog =================================================================== --- ChangeLog (revision 217612) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2014-11-15 H.J. Lu <hongjiu...@intel.com> + + * gcc.target/i386/sibcall-1.c: Don't run on x32 targets, + instead of run on ia32 targets. + 2014-11-15 Marek Polacek <pola...@redhat.com> PR middle-end/63884 Index: gcc.target/i386/sibcall-1.c =================================================================== --- gcc.target/i386/sibcall-1.c (revision 217612) +++ gcc.target/i386/sibcall-1.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ia32 && nonpic } } } */ +/* { dg-do compile { target { { ! x32 } && nonpic } } } */ /* { dg-options "-O2" } */ extern int (*foo)(int); -- H.J.