------- Comment #7 from jakub at gcc dot gnu dot org 2008-11-28 12:56 ------- One bug is IMHO in compute_call_stmt_bb_frequency, what it does doesn't make any sense, as the condition in ?: is never true. I guess --- cgraphbuild.c.jj42008-10-23 13:21:39.000000000 +0200 +++ cgraphbuild.c2008-11-28 13:22:09.000000000 +0100 @@ -111,11 +111,12 @@ compute_call_stmt_bb_frequency (basic_bl int entry_freq = ENTRY_BLOCK_PTR->frequency; int freq;
+ if (!bb->frequency && !entry_freq) + return CGRAPH_FREQ_BASE; + if (!entry_freq) entry_freq = 1; - - freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE - : bb->frequency * CGRAPH_FREQ_BASE / entry_freq); + freq = bb->frequency * CGRAPH_FREQ_BASE / entry_freq; if (freq > CGRAPH_FREQ_MAX) freq = CGRAPH_FREQ_MAX; was intended (as when entry_freq is 0, we don't know how many times more often or less often bb is executed if it's frequency is 0). Anyway, this doesn't solve this, apparently I was wrong with all frequencies being 0. entry block has frequency 9, but the loop has frequency 0, which is definitely wrong. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38074