From 940652d50fe5189458c11ff2fccff7ab38209ded Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Tue, 10 Feb 2015 02:34:41 +0000 Subject: [PATCH] re PR tree-optimization/43378 (IVOPTs messes up code) PR tree-optimization/43378 * gcc.dg/tree-ssa/pr43378.c: New test. From-SVN: r220563 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr43378.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr43378.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f34de6ed35d..ca2cf304a11 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-10 Bin Cheng + + PR tree-optimization/43378 + * gcc.dg/tree-ssa/pr43378.c: New test. + 2015-02-08 Jan Hubicka 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 index 00000000000..1861b4515d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr43378.c @@ -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" } } */ -- 2.30.2