https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82210
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, in e.g. *.ehcleanup2 dump we still have:
pretmp.25_64 = D.1613_19 /[ex] 16;
D.2749_73 = &s.2_61->b{off: pretmp.25_64 * 16}[0];
ivtmp.35_86 = (long unsigned int) D.2749_73;
both before and after that revision, which matches what we emit now, but
somehow in the *.optimized dump it gets optimized away into:
ivtmp.35 = (long unsigned int) &s.2->b{off: D.1613}[0];
where the exact division and multiplication are cancelled. Though, /[ex] is a
guarantee that it is an exact division and thus we are invoking UB if at
runtime that isn't the case.
The *.original dump still doesn't have this:
s.b{off: (long unsigned int) SAVE_EXPR <size> * 2}[i] = 0;
but *.gimple does:
D.1634 = D.1613 /[ex] 16;
s.2->b{off: D.1634 * 16}[i] = 0;