tree-cfg.c (print_loop): Avoid ICEing for loops marked for removal and loops with...
authorRichard Guenther <rguenther@suse.de>
Mon, 13 Aug 2012 13:10:59 +0000 (13:10 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 13 Aug 2012 13:10:59 +0000 (13:10 +0000)
2012-08-13  Richard Guenther  <rguenther@suse.de>

* tree-cfg.c (print_loop): Avoid ICEing for loops marked for
removal and loops with multiple latches.

From-SVN: r190344

gcc/ChangeLog
gcc/tree-cfg.c

index 9c7fffe1053093069cc6212326b6776e22b003ca..57c754b95359cf51227c3e6f30a3c483f0187733 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-13  Richard Guenther  <rguenther@suse.de>
+
+       * tree-cfg.c (print_loop): Avoid ICEing for loops marked for
+       removal and loops with multiple latches.
+
 2012-08-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/53968
index a91b4331c93bb9e0bb31a425260fcdd5fcffcbab..f8d841a86d260aad0581edf675ea7dad534a2281 100644 (file)
@@ -6870,8 +6870,18 @@ print_loop (FILE *file, struct loop *loop, int indent, int verbosity)
   s_indent[indent] = '\0';
 
   /* Print loop's header.  */
-  fprintf (file, "%sloop_%d (header = %d, latch = %d", s_indent,
-          loop->num, loop->header->index, loop->latch->index);
+  fprintf (file, "%sloop_%d (", s_indent, loop->num);
+  if (loop->header)
+    fprintf (file, "header = %d", loop->header->index);
+  else
+    {
+      fprintf (file, "deleted)\n");
+      return;
+    }
+  if (loop->latch)
+    fprintf (file, ", latch = %d", loop->latch->index);
+  else
+    fprintf (file, ", multiple latches");
   fprintf (file, ", niter = ");
   print_generic_expr (file, loop->nb_iterations, 0);