diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-22 02:50:15 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-03-22 02:50:15 +0000 |
commit | 12c94d25ecf719556287a4be26762ad3c1a9e0cd (patch) | |
tree | d7d23d6655c2f0ceba0beacba09ffb8ab6a2d87c | |
parent | 11b4f29a3ac806752f8de43d37ca2b3533b7807e (diff) | |
download | gcc-12c94d25ecf719556287a4be26762ad3c1a9e0cd.tar.gz |
* bb-reorder.c (make_reorder_chain_1): Protect against
when redundant edges are omitted.
* predict.c (dump_prediction): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51160 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/bb-reorder.c | 2 | ||||
-rw-r--r-- | gcc/predict.c | 11 |
3 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bbdadd7effc..a9753047c99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-03-21 DJ Delorie <dj@redhat.com> + + * bb-reorder.c (make_reorder_chain_1): Protect against + when redundant edges are omitted. + * predict.c (dump_prediction): Likewise. + 2002-03-21 Richard Henderson <rth@redhat.com> PR target/5996 diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 2578604889e..3647ad6ec4b 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -205,7 +205,7 @@ make_reorder_chain_1 (bb, prev) e_taken = e; } - next = (taken ? e_taken : e_fall)->dest; + next = ((taken && e_taken) ? e_taken : e_fall)->dest; } /* In the absence of a prediction, disturb things as little as possible diff --git a/gcc/predict.c b/gcc/predict.c index 61cfd63cd7c..56b04365b3f 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -194,7 +194,7 @@ dump_prediction (predictor, probability, bb, used) if (!rtl_dump_file) return; - while (e->flags & EDGE_FALLTHRU) + while (e && (e->flags & EDGE_FALLTHRU)) e = e->succ_next; fprintf (rtl_dump_file, " %s heuristics%s: %.1f%%", @@ -205,9 +205,12 @@ dump_prediction (predictor, probability, bb, used) { fprintf (rtl_dump_file, " exec "); fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC, bb->count); - fprintf (rtl_dump_file, " hit "); - fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC, e->count); - fprintf (rtl_dump_file, " (%.1f%%)", e->count * 100.0 / bb->count); + if (e) + { + fprintf (rtl_dump_file, " hit "); + fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC, e->count); + fprintf (rtl_dump_file, " (%.1f%%)", e->count * 100.0 / bb->count); + } } fprintf (rtl_dump_file, "\n"); |