https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108358
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Both -O2 and -O1 can optimize away the call to foo. For -Os we end up with <bb 2> [local count: 118111600]: l = *.LC0; goto <bb 4>; [100.00%] <bb 3> [local count: 955630225]: bar31_ (); i.0_1 = i; _2 = i.0_1 + 1; i = _2; <bb 4> [local count: 1073741824]: i.1_3 = i; if (i.1_3 != 0) goto <bb 3>; [89.00%] else goto <bb 5>; [11.00%] <bb 5> [local count: 118111600]: j = l; m$h$b_18 = j.h.b; if (m$h$b_18 != 0) goto <bb 7>; [67.00%] else goto <bb 6>; [33.00%] <bb 6> [local count: 38976828]: foo (); but FREs looking through the j = l copy causes us to fail disambiguating against the cycle because of 'abort_on_visited' which I think is a bit overeager here.