diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfg.c | 14 | ||||
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 3 |
3 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 317e2d7..525ad00 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-07-15 Jan Hubicka <jh@suse.cz> + + * cfg.c (update_bb_profile_for_threading): More diagnostic. + * tree-ssa-threadupdate.c (redirect_edges): Update profile of dup_block. + 2005-07-15 Richard Guenther <rguenther@suse.de> * c-common.c (handle_flatten_attribute): New function. @@ -850,7 +850,12 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency, bb->count -= count; if (bb->count < 0) - bb->count = 0; + { + if (dump_file) + fprintf (dump_file, "bb %i count became negative after threading", + bb->index); + bb->count = 0; + } /* Compute the probability of TAKEN_EDGE being reached via threaded edge. Watch for overflows. */ @@ -897,7 +902,12 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency, gcc_assert (bb == taken_edge->src); taken_edge->count -= count; if (taken_edge->count < 0) - taken_edge->count = 0; + { + if (dump_file) + fprintf (dump_file, "edge %i->%i count became negative after threading", + taken_edge->src->index, taken_edge->dest->index); + taken_edge->count = 0; + } } /* Multiply all frequencies of basic blocks in array BBS of length NBBS diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index a89a438..6181b27 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -609,6 +609,9 @@ redirect_edges (void **slot, void *data) fprintf (dump_file, " Threaded jump %d --> %d to %d\n", e->src->index, e->dest->index, rd->dup_block->index); + rd->dup_block->count += e->count; + rd->dup_block->frequency += EDGE_FREQUENCY (e); + EDGE_SUCC (rd->dup_block, 0)->count += e->count; /* Redirect the incoming edge to the appropriate duplicate block. */ e2 = redirect_edge_and_branch (e, rd->dup_block); |