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]

[MIPS, committed] Reverse argument order in const-anchor tests


gcc.target/mips/const-anchor-[12].c started failing after:

2014-04-29  James Greenhalgh  <james.greenhalgh@arm.com>

	* calls.c (initialize_argument_information): Always treat
	PUSH_ARGS_REVERSED as 1, simplify code accordingly.
	(expand_call): Likewise.
	(emit_library_call_calue_1): Likewise.
	* expr.c (PUSH_ARGS_REVERSED): Do not define.
	(emit_push_insn): Always treat PUSH_ARGS_REVERSED as 1, simplify
	code accordingly.

because we now evaluate the arguments in reverse order and because the
way that the const-anchor optimisation is written is (knowingly, I think)
sensitive to instruction order.

I've filed enhancement PR61926 for a version that could cope with both
orders.  In the meantime, and in order to make sure that the optimisation
is still tested, I've committed the patch below to reverse the arguments.
I've added the old order as new XFAILed tests, linked to the PR.

Tested on mips64-linux-gnu and applied.

Thanks,
Richard


gcc/testsuite/
	PR rtl-optimization/61926
	* gcc.target/mips/const-anchor-1.c, gcc.target/mips/const-anchor-2.c:
	Reverse argument order.
	* gcc.target/mips/const-anchor-3.c, gcc.target/mips/const-anchor-4.c:
	New XFAILed tests that match the original order.

Index: gcc/testsuite/gcc.target/mips/const-anchor-1.c
===================================================================
--- gcc/testsuite/gcc.target/mips/const-anchor-1.c	2014-07-27 10:28:49.047970043 +0100
+++ gcc/testsuite/gcc.target/mips/const-anchor-1.c	2014-07-27 10:37:18.023945982 +0100
@@ -2,9 +2,9 @@
    (0x1234000) used to build another constant.  */
 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
 /* { dg-final { scan-assembler-not "0x12330000|305332224" } } */
-/* { dg-final { scan-assembler "\td?addiu\t\\\$5,\\\$\[0-9\]*,-1" } } */
+/* { dg-final { scan-assembler "\td?addiu\t\\\$4,\\\$\[0-9\]*,-1" } } */
 
 NOMIPS16 void f ()
 {
-  g (0x12340001, 0x1233ffff);
+  g (0x1233ffff, 0x12340001);
 }
Index: gcc/testsuite/gcc.target/mips/const-anchor-2.c
===================================================================
--- gcc/testsuite/gcc.target/mips/const-anchor-2.c	2014-07-27 10:28:49.047970043 +0100
+++ gcc/testsuite/gcc.target/mips/const-anchor-2.c	2014-07-27 10:37:18.024945992 +0100
@@ -1,9 +1,9 @@
 /* Derive a constant (0x30001) from another constant.  */
 /* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
 /* { dg-final { scan-assembler-not "0x300000|196608" } } */
-/* { dg-final { scan-assembler "\td?addiu\t\\\$5,\\\$\[0-9\]*,32763" } } */
+/* { dg-final { scan-assembler "\td?addiu\t\\\$4,\\\$\[0-9\]*,32763" } } */
 
 NOMIPS16 void f ()
 {
-  g (0x28006, 0x30001);
+  g (0x30001, 0x28006);
 }
Index: gcc/testsuite/gcc.target/mips/const-anchor-3.c
===================================================================
--- /dev/null	2014-07-15 07:39:28.965430757 +0100
+++ gcc/testsuite/gcc.target/mips/const-anchor-3.c	2014-07-27 10:44:18.927185095 +0100
@@ -0,0 +1,11 @@
+/* Derive a constant (0x1233ffff) from an intermediate value
+   (0x1234000) used to build another constant.  */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+/* See PR61926 for the XFAILs.  */
+/* { dg-final { scan-assembler-not "0x12330000|305332224" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler "\td?addiu\t\\\$5,\\\$\[0-9\]*,-1" { xfail *-*-* } } } */
+
+NOMIPS16 void f ()
+{
+  g (0x12340001, 0x1233ffff);
+}
Index: gcc/testsuite/gcc.target/mips/const-anchor-4.c
===================================================================
--- /dev/null	2014-07-15 07:39:28.965430757 +0100
+++ gcc/testsuite/gcc.target/mips/const-anchor-4.c	2014-07-27 10:44:23.721233442 +0100
@@ -0,0 +1,10 @@
+/* Derive a constant (0x30001) from another constant.  */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+/* See PR61926 for the XFAILs.  */
+/* { dg-final { scan-assembler-not "0x300000|196608" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler "\td?addiu\t\\\$5,\\\$\[0-9\]*,32763" { xfail *-*-* }  } } */
+
+NOMIPS16 void f ()
+{
+  g (0x28006, 0x30001);
+}


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