This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, mips, testsuite] Fix scan on gcc.target/mips/ext-2.c
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Steve Ellcey " <sellcey at mips dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Dec 2012 19:55:44 +0000
- Subject: Re: [patch, mips, testsuite] Fix scan on gcc.target/mips/ext-2.c
- References: <487cd252-3f6e-41d1-b313-ac9dbe928370@EXCHHUB01.MIPS.com>
"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.
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" } } */