https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110361
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-08-07 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. What is interesting is we have: ``` <bb 7> [local count: 525923045]: g = &p; f.0_18 = f; if (f.0_18 == 0) goto <bb 8>; [50.00%] else goto <bb 13>; [50.00%] <bb 9> [local count: 225485782]: g = &p; f.0_36 = f; if (f.0_36 == 0) goto <bb 8>; [50.00%] else goto <bb 13>; [50.00%] ``` Those bb's are exactly the same. Their pred bbs are: ``` <bb 3> [local count: 751619280]: if (e.4_19 == &a) goto <bb 9>; [30.00%] else goto <bb 4>; [70.00%] <bb 4> [local count: 526133498]: if (e.4_19 == &d) goto <bb 7>; [99.96%] else goto <bb 5>; [0.04%] ``` Their succ branch (that matters) is: ``` <bb 13> [local count: 375914866]: c = &m; m ={v} {CLOBBER(eol)}; _22 = e.4_19 == &d; _1 = e.4_19 == &a; _23 = _1 | _22; if (_23 != 0) goto <bb 12>; [25.16%] else goto <bb 10>; [74.84%] ``` So coming into bb13, we know that `(e.4_19 == &d) | (e.4_19 == &a)` is true. Removing the branch to bb 10 which was the call to foo: <bb 10> [local count: 281323581]: foo ();