https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94988
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Last reconfirmed| |2020-05-08 Status|UNCONFIRMED |ASSIGNED Blocks| |57359 Target Milestone|--- |11.0 Ever confirmed|0 |1 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Ah, forgot to update this testcase. This is another instance of PR57359, that is, we may not sink the store to b across the store to *b since b may point to itself and with j == 1 we'd change b = b + 2; *b = x; to *b = x; b = b + 2; note there's a twist for this particular case, namely the preceeding load of 'b' gives us knowledge about the dynamic type of 'b' which means we could use that to assess that we _can_ exchange the stores. But that logic is not implemented. I'll see how to do that. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57359 [Bug 57359] store motion causes wrong code for union access at -O3