https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114932
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Likely Base: (integer(kind=4) *) &block + ((sizetype) ((unsigned long) l0_19(D) * 324) + 36) vs. Base: (integer(kind=4) *) &block + ((sizetype) ((integer(kind=8)) l0_19(D) * 81) + 9) * 4 where we fail to optimize the outer multiply. It's ((unsigned)((signed)x * 81) + 9) * 4 and likely done by extract_muldiv for the case of (unsigned)x. The trick would be to promote the inner multiply to unsigned to make the otherwise profitable transform valid. But best not by enhancing extract_muldiv ...