diff mbox

Adjust hoist-register-pressure* testcases to work for S/390

Message ID 20140410080021.GA12295@maggie
State New
Headers show

Commit Message

Andreas Krebbel April 10, 2014, 8 a.m. UTC
Hi,

the hoist-register-pressure testcases currently fail on S/390 since
the rtl hoist pass requires that the expression to be hoisted can be
assigned without clobbering cc.  We do not have a 32 bit add which
does not clobber cc.

On 64 bit we might use load address if the operands are DImode.  On 31
bit we are out of luck.

The attached patch turns the int types into long for these testcases
and disables them for s390 31bit.

I've verified that they still succeed on power and x86_64.

Ok?

Bye,

-Andreas-


2014-04-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.dg/hoist-register-pressure-1.c: Replace int with long.
	Disable asm scan for s390.
	* gcc.dg/hoist-register-pressure-2.c: Likewise.
	* gcc.dg/hoist-register-pressure-3.c: Likewise.

Comments

Jeff Law April 24, 2014, 10:07 p.m. UTC | #1
On 04/10/14 02:00, Andreas Krebbel wrote:
> Hi,
>
> the hoist-register-pressure testcases currently fail on S/390 since
> the rtl hoist pass requires that the expression to be hoisted can be
> assigned without clobbering cc.  We do not have a 32 bit add which
> does not clobber cc.
>
> On 64 bit we might use load address if the operands are DImode.  On 31
> bit we are out of luck.
>
> The attached patch turns the int types into long for these testcases
> and disables them for s390 31bit.
>
> I've verified that they still succeed on power and x86_64.
>
> Ok?
>
> Bye,
>
> -Andreas-
>
>
> 2014-04-10  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
>
> 	* gcc.dg/hoist-register-pressure-1.c: Replace int with long.
> 	Disable asm scan for s390.
> 	* gcc.dg/hoist-register-pressure-2.c: Likewise.
> 	* gcc.dg/hoist-register-pressure-3.c: Likewise.
OK for the trunk.

Thanks,
Jeff
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
index f5b5302..4aabcb7 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
@@ -1,14 +1,18 @@ 
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
+/* The rtl hoist pass requires that the expression to be hoisted can
+   be assigned without clobbering cc.  For a PLUS rtx on S/390 this
+   requires a load address instruction which is fine on 64 bit but
+   cannot be used on 31 bit since it does a 31 bit add only.  */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { { ! s390-*-* } && nonpic } } } } */
 /* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
-int a[BUF];
+long a[BUF];
 
-void com (int);
-void bar (int);
+void com (long);
+void bar (long);
 
-int foo (int x, int y, int z)
+long foo (long x, long y, long z)
 {
   /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
      because its rtx_cost is too small.  */
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
index 30408f3..f1c927e 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
@@ -1,14 +1,18 @@ 
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* The rtl hoist pass requires that the expression to be hoisted can
+   be assigned without clobbering cc.  For a PLUS rtx on S/390 this
+   requires a load address instruction which is fine on 64 bit but
+   cannot be used on 31 bit since it does a 31 bit add only.  */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { ! s390-*-* } } } } */
 /* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
-int a[BUF];
+long a[BUF];
 
-void com (int);
-void bar (int);
+void com (long);
+void bar (long);
 
-int foo (int x, int y, int z)
+long foo (long x, long y, long z)
 {
   /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
      because its rtx_cost is too small.  */
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
index b050f89..24abaa6 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
@@ -1,14 +1,18 @@ 
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* The rtl hoist pass requires that the expression to be hoisted can
+   be assigned without clobbering cc.  For a PLUS rtx on S/390 this
+   requires a load address instruction which is fine on 64 bit but
+   cannot be used on 31 bit since it does a 31 bit add only.  */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { ! s390-*-* } } } } */
 /* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
-int a[BUF];
+long a[BUF];
 
-void com (int);
-void bar (int);
+void com (long);
+void bar (long);
 
-int foo (int x, int y, int z)
+long foo (long x, long y, long z)
 {
   /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
      because its rtx_cost is too small.  */