https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80155
--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 23 Mar 2017, thopre01 at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80155 > > --- Comment #5 from Thomas Preud'homme <thopre01 at gcc dot gnu.org> --- > (In reply to Richard Biener from comment #4) > > Can you benchmark the 2nd candidate (most appropriate at this stage I think, > > would also fix 77498). > > > > It will cause pessimizations for code that benefits from predictive > > commoning transforms that PRE can do at -O2 because predictive commoning > > doesn't run at -O2. > > The fix for that would be to run predictive commoning at -O2 but in a mode > > that doesn't perform unrolling for example. [even pcom can blow through > > register pressure limits though] > > > > Any other approach to fixing this particular bug cannot be done for GCC 7 > > (even this one is quite late ...). So in the end I'd vote for WONTFIX for > > GCC 7. > > Sadly it doesn't. Well not quite true, there is a very slight improvement but > we're far from the uplift -fno-code-hoisting provides. > > There's maybe more than one bug at play and the reduced testcase only show > one. The testcase shows hardly profitable PRE which the patches should disable (I didn't verify the patches fix the testcase!) code-hoisting (as well as CSE) can increase register pressure and neither transform is register-pressure aware (and the patch doesn't try to mitigate that).