Commit fbc2782e by DJ Delorie Committed by DJ Delorie

bb-reorder.c (make_reorder_chain_1): Protect against when redundant edges are omitted.

* bb-reorder.c (make_reorder_chain_1): Protect against
when redundant edges are omitted.
* predict.c (dump_prediction): Likewise.

From-SVN: r51160
parent c0561434
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> 2002-03-21 Richard Henderson <rth@redhat.com>
PR target/5996 PR target/5996
......
...@@ -205,7 +205,7 @@ make_reorder_chain_1 (bb, prev) ...@@ -205,7 +205,7 @@ make_reorder_chain_1 (bb, prev)
e_taken = e; 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 /* In the absence of a prediction, disturb things as little as possible
......
...@@ -194,7 +194,7 @@ dump_prediction (predictor, probability, bb, used) ...@@ -194,7 +194,7 @@ dump_prediction (predictor, probability, bb, used)
if (!rtl_dump_file) if (!rtl_dump_file)
return; return;
while (e->flags & EDGE_FALLTHRU) while (e && (e->flags & EDGE_FALLTHRU))
e = e->succ_next; e = e->succ_next;
fprintf (rtl_dump_file, " %s heuristics%s: %.1f%%", fprintf (rtl_dump_file, " %s heuristics%s: %.1f%%",
...@@ -205,9 +205,12 @@ dump_prediction (predictor, probability, bb, used) ...@@ -205,9 +205,12 @@ dump_prediction (predictor, probability, bb, used)
{ {
fprintf (rtl_dump_file, " exec "); fprintf (rtl_dump_file, " exec ");
fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC, bb->count); fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC, bb->count);
fprintf (rtl_dump_file, " hit "); if (e)
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, " 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"); fprintf (rtl_dump_file, "\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment