2004-09-18 Jan Hubicka <jh@suse.cz>
+ * tree-cfg.c (thread_jumps): Fix updating of the profile.
+
* tree-optimize.c (tree_rest_of_compilation): Kill forgotten
verify_cgraph call.
thread_jumps (void)
{
edge e, next, last, old;
- basic_block bb, dest, tmp, old_dest, dom;
+ basic_block bb, dest, tmp, old_dest, curr, dom;
tree phi;
int arg;
bool retval = false;
break;
bb_ann (dest)->forwardable = 0;
- dest->frequency -= freq;
- if (dest->frequency < 0)
- dest->frequency = 0;
- dest->count -= count;
- if (dest->count < 0)
- dest->count = 0;
- dest->succ->count -= count;
- if (dest->succ->count < 0)
- dest->succ->count = 0;
}
/* Reset the forwardable marks to 1. */
old_dest = e->dest;
e = redirect_edge_and_branch (e, dest);
+ /* Update the profile. */
+ if (profile_status != PROFILE_ABSENT)
+ for (curr = old_dest; curr != dest; curr = curr->succ->dest)
+ {
+ curr->frequency -= freq;
+ if (curr->frequency < 0)
+ curr->frequency = 0;
+ curr->count -= count;
+ if (curr->count < 0)
+ curr->count = 0;
+ curr->succ->count -= count;
+ if (curr->succ->count < 0)
+ curr->succ->count = 0;
+ }
+
if (!old)
{
/* Update PHI nodes. We know that the new argument should