http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49786
Ian Lance Taylor <ian at airs dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2011.07.20 22:03:04 AssignedTo|unassigned at gcc dot |jamborm at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #12 from Ian Lance Taylor <ian at airs dot com> 2011-07-20 22:03:04 UTC --- I was able to recreate the problem. The count is going negative at line 1926 of ipa-cp.c, the first line setting cs->count here: for (cs = new_node->callees; cs ; cs = cs->next_callee) if (cs->frequency) cs->count = cs->count * new_sum / orig_node_count; else cs->count = 0; In the test case, cs->count, new_sum, and orig_node_count all == 3870557758. Computing 3870557758 * 3870557758 overflows to a negative number. Dividing by 3870557758 leaves the number still negative. This then leads to the failure. For reference, profile_info->sum_max == 2619109064700. I don't know if these numbers are plausible. I think that this code probably needs to be written along the lines of scale_bbs_frequencies_gcov_type. I will leave this for Martin.