]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/54989
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2012 02:17:50 +0000 (02:17 +0000)
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2012 02:17:50 +0000 (02:17 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192976 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/hoist-register-pressure-1.c [moved from gcc/testsuite/gcc.dg/hoist-register-pressure.c with 92% similarity]
gcc/testsuite/gcc.dg/hoist-register-pressure-2.c [new file with mode: 0644]

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
similarity index 92%
rename from gcc/testsuite/gcc.dg/hoist-register-pressure.c
rename to gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
index 6077f1e578228f71c25e1084907854b43623a4d2..01e5ed4fbb5312a8ff8852ccac33426176b8def9 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
-/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
 
 #define BUF 100
 int a[BUF];
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;
+}