[Bug ipa/95769] Constant expression in inline function not optimized

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 22 07:45:53 GMT 2020


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If we are going to optimize this at IPA time, I'll note we'd need a separate
middle-end IL evaluation code, because the FE one isn't usable for this (not
even through a langhook), because it relies on the IL being unfolded FE trees
and has all the language imposed restrictions etc.
I think I've mentioned IL evaluation as something useful for loops to be able
to evaluate all their side-effects and judge if they are small enough (not too
much overwritten memory, etc.) to replace the original loop, and if we have it,
using it for functions to whose arguments we propagate constants, perhaps using
the constexpr as a hint to try somewhat longer, could work.


More information about the Gcc-bugs mailing list