re PR tree-optimization/57511 (Missing SCEV final value replacement)
authorRichard Biener <rguenther@suse.de>
Mon, 2 Sep 2013 13:24:30 +0000 (13:24 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 2 Sep 2013 13:24:30 +0000 (13:24 +0000)
2013-09-02  Richard Biener  <rguenther@suse.de>

PR middle-end/57511
* tree-scalar-evolution.c (instantiate_scev_name): Allow
non-linear SCEVs.

* gcc.dg/tree-ssa/sccp-1.c: New testcase.

From-SVN: r202168

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c [new file with mode: 0644]
gcc/tree-scalar-evolution.c

index 2ffa49e1750a374b3158ac46c4cc602f8dc3e9a3..498f68e4027ee756db9be44bd0526c564820e35e 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-02  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/57511
+       * tree-scalar-evolution.c (instantiate_scev_name): Allow
+       non-linear SCEVs.
+
 2013-09-02  Richard Biener  <rguenther@suse.de>
 
        * tree-affine.c (add_elt_to_tree): Avoid converting all pointer
index 4cb359c3ca1082f3e36c637e8877b4a927dad820..b190c4d382aafc54006337d1b3a7e6e038b3f926 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-02  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/57511
+       * gcc.dg/tree-ssa/sccp-1.c: New testcase.
+
 2013-09-02  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/loop-4.c: Adjust scan looking for one memory
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c
new file mode 100644 (file)
index 0000000..633a37a
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int main(int argc, char* argv[])
+{
+  int i, a = 0;
+  for (i=0; i < 10; i++)
+    a += i + 0xff00ff;
+  return a;
+}
+
+/* There should be no loop left.  */
+
+/* { dg-final { scan-tree-dump-times "goto" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index c7e9d4b46cdfdda5eb6b7b0f557ce076d2281db5..bed621fe052b785de8a0baac73b30fe2ed2bfaed 100644 (file)
@@ -2252,6 +2252,7 @@ instantiate_scev_name (basic_block instantiate_below,
   else if (res != chrec_dont_know)
     {
       if (inner_loop
+         && def_bb->loop_father != inner_loop
          && !flow_loop_nested_p (def_bb->loop_father, inner_loop))
        /* ???  We could try to compute the overall effect of the loop here.  */
        res = chrec_dont_know;