https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114236
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX CC| |rguenth at gcc dot gnu.org --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Executing store motion of MEM[(short int *)&g_16] from loop 2 Re-issueing dependent store of *g_70.2_4 from loop 2 on exit 4 -> 5 Moving statement The extra store is required to enable sinking of the store to g_16 as we don't know whether g_70 points to aliased memory. I think we fail to realize that *g_70 is loop invariant as well, but what you observe is a feature - it allows reducing the number of stores to g_16.