https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92734
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The (A +- CST1) +- CST2 -> A + CST3 pattern already does handle casts it seems, it is just the other two that don't. That has been added in r249447 with a follow-up fix in r257683.