And the missed patch.

Thanks,
bin

> -----Original Message-----
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> ow...@gcc.gnu.org] On Behalf Of Bin Cheng
> Sent: Monday, February 09, 2015 2:07 PM
> To: gcc-patches@gcc.gnu.org
> Subject: [PATCH PR43378]Add test case for the issue
> 
> Hi,
> I crossed to PR43378 and found it had already been fixed on trunk long
> before.  I am adding a test case and going to close it after this patch.
> The case is tested, Is it OK?
> 
> 2015-02-09  Bin Cheng  <bin.ch...@arm.com>
> 
>       PR tree-optimization/43378
>       * gcc.dg/tree-ssa/pr43378.c: New test.
> 
> 
> 
Index: gcc/testsuite/gcc.dg/tree-ssa/pr43378.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/pr43378.c     (revision 0)
+++ gcc/testsuite/gcc.dg/tree-ssa/pr43378.c     (revision 0)
@@ -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" } } */

Reply via email to