aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBasile Starynkevitch <basile@starynkevitch.net>2007-09-06 06:38:09 +0000
committerBasile Starynkevitch <bstarynk@gcc.gnu.org>2007-09-06 06:38:09 +0000
commit0497c836d0e7152cd8a1beba1c7852281708b60d (patch)
treef8d0ac6cc16986de424aa4ea95e5b1704be7860a /gcc
parentbb0500b075cf4897caa8b59f528480bf4a23d367 (diff)
downloadgcc-0497c836d0e7152cd8a1beba1c7852281708b60d.zip
gcc-0497c836d0e7152cd8a1beba1c7852281708b60d.tar.gz
gcc-0497c836d0e7152cd8a1beba1c7852281708b60d.tar.bz2
cfg.c (dump_bb_info, dump_edge_info): Added cfun test for
robustness. From-SVN: r128176
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cfg.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c80a635..c908108 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-06 Basile Starynkevitch <basile@starynkevitch.net>
+
+ * cfg.c (dump_bb_info, dump_edge_info): Added cfun test for
+ robustness.
+
2007-09-05 Ian Lance Taylor <iant@google.com>
* tree-pretty-print.c (dump_decl_name): Cast LABEL_DECL_UID to int
diff --git a/gcc/cfg.c b/gcc/cfg.c
index e397bf5..c1d93b6 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -534,9 +534,11 @@ dump_bb_info (basic_block bb, bool header, bool footer, int flags,
fprintf (file, ", loop_depth %d, count ", bb->loop_depth);
fprintf (file, HOST_WIDEST_INT_PRINT_DEC, bb->count);
fprintf (file, ", freq %i", bb->frequency);
- if (maybe_hot_bb_p (bb))
+ /* Both maybe_hot_bb_p & probably_never_executed_bb_p functions
+ crash without cfun. */
+ if (cfun && maybe_hot_bb_p (bb))
fprintf (file, ", maybe hot");
- if (probably_never_executed_bb_p (bb))
+ if (cfun && probably_never_executed_bb_p (bb))
fprintf (file, ", probably never executed");
fprintf (file, ".\n");
@@ -665,10 +667,10 @@ void
dump_edge_info (FILE *file, edge e, int do_succ)
{
basic_block side = (do_succ ? e->dest : e->src);
-
- if (side == ENTRY_BLOCK_PTR)
+ /* both ENTRY_BLOCK_PTR & EXIT_BLOCK_PTR depend upon cfun */
+ if (cfun && side == ENTRY_BLOCK_PTR)
fputs (" ENTRY", file);
- else if (side == EXIT_BLOCK_PTR)
+ else if (cfun && side == EXIT_BLOCK_PTR)
fputs (" EXIT", file);
else
fprintf (file, " %d", side->index);