https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126998
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code,
| |missed-optimization
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Instead loop splitting is applied (-fno-loop-split resolves the issue). Loop
splitting itself leaves the code in a sorry state:
_8 = 1;
if (_8 <= 9)
goto <bb 24>; [99.95%]
else
goto <bb 8>; [0.05%]
so moving invariants there isn't a workaround.
I thought of building fully invariant operations from scalars and move
defs when code generating them, but this does not work in the case we
have pattern recognition work on all invariant operations (so we should
stop that then). So we'd have to avoid recognizing (partly) invariant
patterns.
It _is_ suboptimal to use dot-prod with an invariant multiplication.