http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58553
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> --- On Mon, 30 Sep 2013, law at redhat dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58553 > > --- Comment #8 from Jeffrey A. Law <law at redhat dot com> --- > Yes, threading is rotating the loop in "interesting" ways -- I was going to > look at that independently of the correctness issue. > > One of the things I've noticed as I've been laying down some infrastructure > for > the FSA optimization is much of the work Zdenek did to prevent threading > through loop headers and such isn't working as well as we'd like. The basic rule should be that threading through loop headers is ok if 1) it doesn't end up creating loops with multiple entries, 2) it doesn't effectively unroll the loop, though the size constraints in the threading cost model should put up a reasonable limit here, but as we are threading multiple times we eventually ended up peeling N iterations 1) is most important as we cannot handle loops with multiple entries at all. Peeling all loops N times is of course equally bad. Richard.