http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58742

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
The patch will fix the regression part, to be left to optimize is the
pointer offset association bits which should best be done in GIMPLE
reassoc which doesn't yet associate POINTER_PLUS_EXPR yet.  It could
do that with "transparently" handling

  ptr p+ (offset + ...)

as

  (sizetype) ptr + (offset + ...)

and in the final chain, if ptr prevailed, associate it first and
re-instantiate the POINTER_PLUS_EXPR, otherwise keep the sizetype
result and convert it to the pointer type (sizetype arith has
wrapping overflow so you cannot simply take any pointer in the
addition chain as the base for a POINTER_PLUS_EXRP).

Reply via email to