https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100112
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |ipa Keywords| |missed-optimization Ever confirmed|0 |1 CC| |marxin at gcc dot gnu.org Status|UNCONFIRMED |NEW Version|unknown |11.0 Last reconfirmed| |2021-04-20 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- It's very late eliminated at -O1 (DCE7) while with -O3 we still have <bb 2> [local count: 1073741824]: _2 = e; _3 = _2 + 1; e = _3; c.1_4 = c; if (c.1_4 == 0B) goto <bb 3>; [48.88%] else goto <bb 4>; [51.12%] <bb 3> [local count: 524845000]: foo (); there. In the end it's some IPA issue, failing to make 'c' readonly at -O3 vs. -O1.