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]

[PATCH, i386]: Fix spurious testsuite failure in gcc.target/i386/pad-10.c


Hello!

Recently, gcc become smart enough to merge:

        leal    (%rdi), %eax
        addl    %esi, %eax

into

        leal    (%rsi,%rdi), %eax

The generated sequence (without ret) becomes shorter than 4 instructions:

        cmpl    $1, %esi
        leal    (%rsi,%rdi), %eax
        je      .L8
        nop
        nop
        ret

and nop insertion for ATOM was triggered.

Following patch changes arithmetic to again generate correct number of
instructions, without compromising the intention of the test.

        leal    (%rsi), %eax
        subl    %edi, %eax
        cmpl    $1, %esi
        je      .L8
        ret

2012-09-30  Uros Bizjak  <ubizjak@gmail.com>

	* gcc.target/i386/pad-10.c (foo2): Return x - z.

Tested on x86_64-pc-linux-gnu, committed to mainline SVN.

Uros.

Index: gcc.target/i386/pad-10.c
===================================================================
--- gcc.target/i386/pad-10.c    (revision 191866)
+++ gcc.target/i386/pad-10.c    (working copy)
@@ -15,5 +15,5 @@
       return z;
     }
   else
-    return x + z;
+    return x - z;
 }


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