diff mbox

[mips,testsuite] Fix scan on gcc.target/mips/ext-2.c

Message ID 87sj7d1y2n.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford Dec. 10, 2012, 7:55 p.m. UTC
"Steve Ellcey " <sellcey@mips.com> writes:
> In looking at the failure of gcc.target/mips/ext-2.c, it looks like the
> GCC compiler is now figuring out that it can use a 32 bit ext instruction
> instead of a 64 bit dext instruction and that this is why the test
> fails.  Here is a patch to look for 'ext' or 'dext', OK to checkin?
> It fixes the failure for me and I see no reason why GCC should not use
> the ext instruction instead of dext in this case.

Agreed, but it no longer matches the original intention of the test:

/* Turn the truncate,zero_extend,lshiftrt sequence before the or into a
   zero_extract.  The truncate is due to TARGET_PROMOTE_PROTOTYPES, the
   zero_extend to PROMOTE_MODE.  */

because we've lost the truncate.

I went for the patch below instead, after checking that the uncombined
sequence really was a truncate/zero_extend/lshiftft sequence.  Tested on
mips64-linux-gnu (where the test also failed for -mabi=n32 and -mabi=32,
but not for -mabi=64).  Applied.

Richard


gcc/testsuite/
	* gcc.target/mips/ext-2.c: Require -mlong64.
diff mbox

Patch

Index: gcc/testsuite/gcc.target/mips/ext-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/ext-2.c	2012-08-27 17:31:22.000000000 +0100
+++ gcc/testsuite/gcc.target/mips/ext-2.c	2012-12-10 19:50:25.159758211 +0000
@@ -2,7 +2,7 @@ 
    zero_extract.  The truncate is due to TARGET_PROMOTE_PROTOTYPES, the
    zero_extend to PROMOTE_MODE.  */
 /* { dg-do compile } */
-/* { dg-options "isa_rev>=2 -mgp64" } */
+/* { dg-options "isa_rev>=2 -mgp64 -mlong64" } */
 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
 /* { dg-final { scan-assembler "\tdext\t" } } */
 /* { dg-final { scan-assembler-not "\tand" } } */