https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89922
--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 4 Apr 2019, antoshkka at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89922 > > --- Comment #2 from Antony Polukhin <antoshkka at gmail dot com> --- > The estimation is very close to the actual result for the loop. > > But it does not take into the account the instructions before the loop that > are > eliminated due to unrolling. Some heuristic like "initializing the local > variable with goes away for unrolled loops if the variable is rewritten in > loop > or if the variable is not used outside the loop" Sure, but you'd need to collect some function-scope information to feed such heuristics to not fall on the wrong-side if those constraints are not met. Was the testcase just an artificial one or does it appear (in this isolated form!) in a real application/benchmark?