re PR middle-end/64083 (ICE: in fix_loop_structure, at loop-init.c:252 compiling...
authorRichard Biener <rguenther@suse.de>
Thu, 27 Nov 2014 09:57:13 +0000 (09:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 27 Nov 2014 09:57:13 +0000 (09:57 +0000)
2014-11-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/64083
* tree-ssa-threadupdate.c (thread_through_all_blocks): Do not
forcibly mark loop for removal the wrong way.

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

From-SVN: r218115

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

index 999686f6ee18c33242e4ea1582daa20bdbf239a7..71828c2299de6af33d7ddec2f9583821eda925fa 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-27  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/64083
+       * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not
+       forcibly mark loop for removal the wrong way.
+
 2014-11-27  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/63704
index 5e671fa92fef85435c1ea41a4e2abb5435208f37..5fc10c2b7940a356c3c1848616c3256ce53ebe54 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-27  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/64083
+       * gcc.dg/torture/pr64083.c: New testcase.
+
 2014-11-27  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61634
diff --git a/gcc/testsuite/gcc.dg/torture/pr64083.c b/gcc/testsuite/gcc.dg/torture/pr64083.c
new file mode 100644 (file)
index 0000000..3c3e5a6
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int a, b;
+void
+fn1 ()
+{
+  int c = 0;
+  while (b)
+    {
+      switch (c)
+    case 1:
+       fn1 ();
+       if (a)
+         c = 1;
+       b = 0;
+    }
+}
index ca0b8bfdd4bcc37851ba7d2f48d65255aa713ac5..a8243aea68ada6c91303d7cbf3f8aa674b8e00d4 100644 (file)
@@ -2428,16 +2428,8 @@ thread_through_all_blocks (bool may_peel_loop_headers)
                /* Our path is still valid, thread it.  */
                if (e->aux)
                  {
-                   struct loop *loop = (*path)[0]->e->dest->loop_father;
-
                    if (thread_block ((*path)[0]->e->dest, false))
-                     {
-                       /* This jump thread likely totally scrambled this loop.
-                          So arrange for it to be fixed up.  */
-                       loop->header = NULL;
-                       loop->latch = NULL;
-                       e->aux = NULL;
-                     }
+                     e->aux = NULL;
                    else
                      {
                        delete_jump_thread_path (path);