2013-09-02 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Sep 2013 13:24:30 +0000 (13:24 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Sep 2013 13:24:30 +0000 (13:24 +0000)
PR middle-end/57511
* tree-scalar-evolution.c (instantiate_scev_name): Allow
non-linear SCEVs.

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

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

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 2ffa49e..498f68e 100644 (file)
@@ -1,5 +1,11 @@
 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
        arithmetic to sizetype.
 
index 4cb359c..b190c4d 100644 (file)
@@ -1,5 +1,10 @@
 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
        reference.
 
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 c7e9d4b..bed621f 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;