aboutsummaryrefslogtreecommitdiff
path: root/gcc/graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/graph.c')
-rw-r--r--gcc/graph.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/graph.c b/gcc/graph.c
index 51837308bb4..1ecfdf0b761 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -213,7 +213,8 @@ draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no,
unsigned int i;
const char *fillcolors[3] = { "grey88", "grey77", "grey66" };
- if (loop->latch != EXIT_BLOCK_PTR)
+ if (loop->header != NULL
+ && loop->latch != EXIT_BLOCK_PTR)
pp_printf (pp,
"\tsubgraph cluster_%d_%d {\n"
"\tstyle=\"filled\";\n"
@@ -229,6 +230,9 @@ draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no,
for (struct loop *inner = loop->inner; inner; inner = inner->next)
draw_cfg_nodes_for_loop (pp, funcdef_no, inner);
+ if (loop->header == NULL)
+ return;
+
if (loop->latch == EXIT_BLOCK_PTR)
body = get_loop_body (loop);
else