[Bug rtl-optimization/78812] [5/6/7 Regression] Wrong code generation due to hoisting memory load across function call

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 16 09:50:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78812

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> Can't we insert on the edge and commit edge insertions late?  Or simply
> split the block for this case?

Well, for the case of calls there typically are 2 edges, not just one (the
abnormal one and normal fallthru), except for noreturn throwing calls.
So inserting on the edges would usually mean undoing the hoisting.
Note if the expression doesn't contain MEM (and isn't clobbered by the call,
but that should just affect hard registers), hoisting it before the call is
just fine.


More information about the Gcc-bugs mailing list