https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67376
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #10) > The a.e + 1 != 0 and a.e + 2 != 0 cases we used to fold them because > try_move_mult_to_index would fold them into ADDR_EXPR of some field, which > intentionally no longer happens. So, I guess we want instead some > simplification of POINTER_PLUS_EXPR<ADDR_EXPR<something>, INTEGER_CST> that > would say use get_inner_reference on something, add (in offset_int?) the > constant offset to it and determine if it is always non-zero. What if we restored try_move_mult_to_index for the case where the offset is within the known bounds of an array? That's the case that C++ is interested in.