This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] gcc.target/i386/cmov4.c regressed but was still passing
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Daniel Berlin <dberlin at dberlin dot org>, Diego Novillo <dnovillo at redhat dot com>
- Date: Thu, 23 Aug 2007 11:30:43 +0200
- Subject: [PATCH] gcc.target/i386/cmov4.c regressed but was still passing
The three tests cmov3.c, cmov4.c, xchg-2.c fail because their
scan-assembler directory matches the file name in the .s file, rather
than the instruction.
Unfortunately, this shows that cmov4.c regressed. I didn't really look
at the failure mode, but IMO store sinking should happen and it does not.
int *nodekind;
float *nodekindf;
...
for (i = 0; i < ARCHnodes; i++) {
nodekind[i] = (int) nodekindf[i]; /* <<< */
if (nodekind[i] == 3)
nodekind[i] = 1;
}
In the marked statement, the nodekind variable gets a new VDEF, which is
wrong:
D.2012_13 = (int) D.2011_12;
# ARCHnodes_36 = VDEF <ARCHnodes_9>
# nodekind_37 = VDEF <nodekind_44>
# nodekindf_38 = VDEF <nodekindf_45>
# SMT.8_39 = VDEF <SMT.8_46>
*D.2008_7 = D.2012_13;
(Note that this sinking didn't happen in 4.1 either, so that's not the
cause of the regression).
I'll apply the attached patch in 24 hours unless anybody complains.
Paolo
2007-08-22 Paolo Bonzini <bonzini@gnu.org>
* gcc.target/i386/cmov3.c: Fix scan-assembler.
* gcc.target/i386/cmov4.c: Fix scan-assembler.
* gcc.target/i386/xchg-2.c: Fix scan-assembler.
Index: testsuite/gcc.target/i386/cmov3.c
===================================================================
--- testsuite/gcc.target/i386/cmov3.c (revision 127728)
+++ testsuite/gcc.target/i386/cmov3.c (working copy)
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=k8" } */
-/* { dg-final { scan-assembler "cmov" } } */
+/* { dg-final { scan-assembler "cmov\[^3\]" } } */
/* This conditional move is fastest to be done using cmov. */
t(int a, int b)
Index: testsuite/gcc.target/i386/cmov4.c
===================================================================
--- testsuite/gcc.target/i386/cmov4.c (revision 127728)
+++ testsuite/gcc.target/i386/cmov4.c (working copy)
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=k8" } */
-/* { dg-final { scan-assembler "cmov" } } */
+/* { dg-final { scan-assembler "cmov\[^4\]" } } */
/* Verify that if conversion happends for memory references. */
int ARCHnodes;
Index: testsuite/gcc.target/i386/xchg-2.c
===================================================================
--- testsuite/gcc.target/i386/xchg-2.c (revision 127728)
+++ testsuite/gcc.target/i386/xchg-2.c (working copy)
@@ -6,4 +6,4 @@ unsigned short good(unsigned short a)
return (a >> 8 | a << 8);
}
-/* { dg-final { scan-assembler "xchg" } } */
+/* { dg-final { scan-assembler "xchgb" } } */