http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47033
Summary: loop distribution has problems on sane testcases Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: hubi...@gcc.gnu.org The following patch: Index: predict.c =================================================================== --- predict.c (revision 168047) +++ predict.c (working copy) @@ -126,7 +126,7 @@ maybe_hot_frequency_p (int freq) if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE && freq <= (ENTRY_BLOCK_PTR->frequency * 2 / 3)) return false; - if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)) + if (freq < ENTRY_BLOCK_PTR->frequency / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)) return false; return true; } makes the testcase gcc.dg/tree-ssa/ldist-pr45948.c to fail. The testcase seems to test if the loop is converted to memsets. The problem is that with the patch above the code is considered hot and loop gets header copied as a result the code in loop distribution seems confused. Profile info is wrong and one copy of loop stays in the code.