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: [committed,testsuite] Not run gcc.target/i386/sibcall-1.c on PIC targets


On Sat, Nov 15, 2014 at 12:29 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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.
>

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.lu@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  <polacek@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.


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