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: [PATCH] gcc.target/i386/cmov4.c regressed but was still passing


On 8/23/07, Paolo Bonzini <bonzini@gnu.org> wrote:
> 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.

So, do the testcases still work in 4.2/4.1?  Can you please file a bugreport?
Can you XFAIL the testcases if they also really fail in 4.2?

Thanks,
Richard.

> 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" } } */
>
>


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