This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, i386]: Fix spurious testsuite failure in gcc.target/i386/pad-10.c
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Sep 2012 21:26:00 +0200
- Subject: [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;
}