re PR target/54989 (FAIL: gcc.dg/hoist-register-pressure.c scan-rtl-dump hoist "PRE...
authorBin Cheng <bin.cheng@arm.com>
Tue, 30 Oct 2012 02:17:50 +0000 (02:17 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Tue, 30 Oct 2012 02:17:50 +0000 (02:17 +0000)
PR target/54989
* gcc.dg/hoist-register-pressure-1.c: Rename from
hoist-register-pressure.c. Add nonpic condition.
* gcc.dg/hoist-register-pressure-2.c: New testcase.

From-SVN: r192976

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/hoist-register-pressure-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/hoist-register-pressure-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/hoist-register-pressure.c [deleted file]

index f6a812210056de1dfaa8766f61458b335ae9995a..627d80ddb376104f49bcee704a8f050ffbd970d2 100644 (file)
@@ -1,3 +1,10 @@
+2012-10-30  Bin Cheng  <bin.cheng@arm.com>
+
+       PR target/54989
+       * gcc.dg/hoist-register-pressure-1.c: Rename from
+       hoist-register-pressure.c. Add nonpic condition.
+       * gcc.dg/hoist-register-pressure-2.c: New testcase.
+
 2012-10-29  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR c++/54930
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
new file mode 100644 (file)
index 0000000..01e5ed4
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-options "-Os -fdump-rtl-hoist" }  */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+  /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+     because its rtx_cost is too small.  */
+  if (z)
+    {
+      a[1] = a[0] + a[2];
+      a[2] = a[1] + a[3];
+      a[3] = a[2] + a[4];
+      a[4] = a[3] + a[5];
+      a[5] = a[4] + a[6];
+      a[6] = a[5] + a[7];
+      a[7] = a[6] + a[8];
+      com (x+y);
+    }
+  else
+    {
+      bar (x+y);
+    }
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
new file mode 100644 (file)
index 0000000..7f973fe
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-options "-Os -fdump-rtl-hoist" }  */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+  /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+     because its rtx_cost is too small.  */
+  if (z)
+    {
+      a[1] = a[0];
+      a[2] = a[1];
+      a[3] = a[3];
+      a[4] = a[5];
+      a[5] = a[7];
+      a[6] = a[11];
+      a[7] = a[13];
+      a[8] = a[17];
+      com (x+y);
+    }
+  else
+    {
+      bar (x+y);
+    }
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure.c b/gcc/testsuite/gcc.dg/hoist-register-pressure.c
deleted file mode 100644 (file)
index 6077f1e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* { dg-options "-Os -fdump-rtl-hoist" }  */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
-
-#define BUF 100
-int a[BUF];
-
-void com (int);
-void bar (int);
-
-int foo (int x, int y, int z)
-{
-  /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
-     because its rtx_cost is too small.  */
-  if (z)
-    {
-      a[1] = a[0] + a[2];
-      a[2] = a[1] + a[3];
-      a[3] = a[2] + a[4];
-      a[4] = a[3] + a[5];
-      a[5] = a[4] + a[6];
-      a[6] = a[5] + a[7];
-      a[7] = a[6] + a[8];
-      com (x+y);
-    }
-  else
-    {
-      bar (x+y);
-    }
-
-  return 0;
-}