https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71437
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- The issue with the optimization opportunity is that IPA reference does not compute that GetIN does not modify pL because its analysis is restricted to variables local to the compilation unit. Using -fwhole-program fixes that. I didn't check whether PRE performs the desired optimization then - the code gets quite obfuscated with -fwhole-program. The r235817 issue is likely spurious - the SSA dumps of GCC 6 and trunk agree and thus differences are likely due to SSA numbering differences. The usual suspect is out-of SSA coalescing (without having verified that).