re PR rtl-optimization/55270 (ICE in get_loop_body, at cfgloop.c:823)
authorRichard Biener <rguenther@suse.de>
Tue, 29 Jan 2013 10:40:24 +0000 (10:40 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 29 Jan 2013 10:40:24 +0000 (10:40 +0000)
2013-01-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/55270
* tree-ssa-dom.c (eliminate_degenerate_phis): If we changed
the CFG, schedule loops for fixup.

* gcc.dg/torture/pr55270.c: New testcase.

From-SVN: r195533

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

index bf77fb0..4765ab7 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-29  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/55270
+       * tree-ssa-dom.c (eliminate_degenerate_phis): If we changed
+       the CFG, schedule loops for fixup.
+
 2013-01-29  Nick Clifton  <nickc@redhat.com>
 
        * config/rl78/rl78.c (rl78_regno_mode_code_ok_for_base_p): Allow
index ebc18d9..936053f 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-29  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/55270
+       * gcc.dg/torture/pr55270.c: New testcase.
+
 2013-01-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/56117
diff --git a/gcc/testsuite/gcc.dg/torture/pr55270.c b/gcc/testsuite/gcc.dg/torture/pr55270.c
new file mode 100644 (file)
index 0000000..0b7f906
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+unsigned a, b, c;
+
+void f(void)
+{
+  for(; a; a++)
+    {
+      long *p1 = (long *)&b;
+
+      if(*p1)
+       return;
+
+      if(b && (*p1 = b) || c && ++*p1)
+       {
+         unsigned *p2 = &b;
+
+         for(*p2 = 0; *p2 < 1;)
+           for(; b; b++);
+       }
+    }
+}
index dfb908d..e8b1551 100644 (file)
@@ -3006,7 +3006,12 @@ eliminate_degenerate_phis (void)
     }
 
   if (cfg_altered)
-    free_dominance_info (CDI_DOMINATORS);
+    {
+      free_dominance_info (CDI_DOMINATORS);
+      /* If we changed the CFG schedule loops for fixup by cfgcleanup.  */
+      if (current_loops)
+       loops_state_set (LOOPS_NEED_FIXUP);
+    }
 
   /* Propagation of const and copies may make some EH edges dead.  Purge
      such edges from the CFG as needed.  */