------- Comment #8 from ebotcazou at gcc dot gnu dot org 2007-11-05 22:44 ------- > Re. comment #5, yes the code is right to add the frequencies together. > After cross jumping, the tail-merged block is traversed with the combined > frequencies of the new incoming edges, so adding the frequencies is correct.
That's not clear in my opinion. In any case, there is something wrong: redirect_to->frequency += src1->frequency; is performed before the weighted mean if (!redirect_to->frequency && !src1->frequency) s->probability = (s->probability + s2->probability) / 2; else s->probability = ((s->probability * redirect_to->frequency + s2->probability * src1->frequency) / (redirect_to->frequency + src1->frequency)); so the weights are screwed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33737