This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Prevent ICE in flow_loop_dump
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] Prevent ICE in flow_loop_dump
- From: Diego Novillo <dnovillo at redhat dot com>
- Date: Sun, 26 Aug 2001 23:51:37 -0400
- Organization: Red Hat Canada
flow_loop_dump assumes that loop->first->head and loop->last->end
are set. This is not true in the case of tree flowgraphs.
OK to commit to trunk?
Diego.
* flow.c (flow_loop_dump): Do not display insn UIDs if
the basic blocks in the loop contain no RTL instructions.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.471
diff -d -p -d -u -p -r1.471 flow.c
--- flow.c 2001/08/23 15:33:12 1.471
+++ flow.c 2001/08/27 03:42:23
@@ -9176,11 +9176,17 @@ flow_loop_dump (loop, file, loop_dump_au
if (! loop || ! loop->header)
return;
- fprintf (file, ";;\n;; Loop %d (%d to %d):%s%s\n",
- loop->num, INSN_UID (loop->first->head),
- INSN_UID (loop->last->end),
- loop->shared ? " shared" : "",
- loop->invalid ? " invalid" : "");
+ if (loop->first->head && loop->last->end)
+ fprintf (file, ";;\n;; Loop %d (%d to %d):%s%s\n",
+ loop->num, INSN_UID (loop->first->head),
+ INSN_UID (loop->last->end),
+ loop->shared ? " shared" : "",
+ loop->invalid ? " invalid" : "");
+ else
+ fprintf (file, ";;\n;; Loop %d:%s%s\n", loop->num,
+ loop->shared ? " shared" : "",
+ loop->invalid ? " invalid" : "");
+
fprintf (file, ";; header %d, latch %d, pre-header %d, first %d, last %d\n",
loop->header->index, loop->latch->index,
loop->pre_header ? loop->pre_header->index : -1,