https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97135
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- It's lim4 that does the bogus transform. It seems to be confused by the dead store in BB3: <bb 3> [local count: 118111600]: a = 1; a = 6; *d.2_3 = 0; ivtmp.15_9 = ivtmp.15_24 + 1; if (c.7_7 != 0) goto <bb 9>; [5.50%] else goto <bb 10>; [94.50%] and re-materializes the a = 1 store but not the a = 6 one.