https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109791
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- DOMs scoped tables do not help. The crux is really the PHI: __i_14 = PHI <&MEM <char[3]> [(void *)&str + 1B](10), &MEM <char[3]> > [(void *)&str + 2B](9)> there's no single value that exposes &str + offset. For _4 = (unsigned long) &MEM <char[3]> [(void *)&str + 2B]; we might want to go and express it as _4' = (unsigned long) &str; _4 = _4' + 2; but the issue with the PHI node remains unless we sink the &str part (but there's many uses of __i_14). I guess it's still the "easiest" way to get rangers help. Aka make # __i_14' = PHI <1(10), 2(9)> __i_14 = &str + __i_14'; // would be a POINTER_PLUS_EXPR it's probably still not a complete fix but maybe a good start. Of course it increases the number of stmts - &MEM[&str + 1B] was an 'invariant' (of course the PHI result isn't). There's not a good place for this transform - we never "fold" PHIs (and this would be an un-folding).
