re PR tree-optimization/43378 (IVOPTs messes up code)
authorBin Cheng <bin.cheng@arm.com>
Tue, 10 Feb 2015 02:34:41 +0000 (02:34 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Tue, 10 Feb 2015 02:34:41 +0000 (02:34 +0000)
PR tree-optimization/43378
* gcc.dg/tree-ssa/pr43378.c: New test.

From-SVN: r220563

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr43378.c [new file with mode: 0644]

index f34de6ed35d1460073937631584b87048c223437..ca2cf304a111c4d3ec2cde9788779fe473bd21e0 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-10  Bin Cheng  <bin.cheng@arm.com>
+
+       PR tree-optimization/43378
+       * gcc.dg/tree-ssa/pr43378.c: New test.
+
 2015-02-08  Jan Hubicka  <hubicka@ucw.cz>
 
        PR ipa/64978
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr43378.c b/gcc/testsuite/gcc.dg/tree-ssa/pr43378.c
new file mode 100644 (file)
index 0000000..1861b45
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts" } */
+
+void bar (int, int, int);
+void foo (int left, int rite, int element)
+{
+  while (left <= rite)
+    {
+      rite -= element;
+      bar (left, rite, element);
+      left += element;
+    }
+}
+
+/* { dg-final { scan-tree-dump-times "rite_\[0-9\]* = rite_\[0-9\]* - element" 1 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times "left_\[0-9\]* = left_\[0-9\]* \\+ element|left_\[0-9\]* = element_\[0-9\]*\\(D\\) \\+ left" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */