https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107704
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization, | |testsuite-fail Ever confirmed|0 |1 Target Milestone|--- |13.0 Status|UNCONFIRMED |NEW Last reconfirmed| |2022-11-16 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- So the only change is if (_11 == 0) - goto <bb 6>; [50.00%] - else goto <bb 9>; [50.00%] -;; succ: 6 -;; 9 + else + goto <bb 6>; [50.00%] ;; basic block 6, loop depth 0 ;; pred: 5 goto <bb 9>; [100.00%] that's which edge has the forwarder. We are not good in preserving a canonical form here and (repeated) CFG cleanup call yield either result depending on which forwarder is removed first. IIRC we've seen these kind of differences before. An improvement here would be to enforce some processing order when removing forwarders, like process EDGE_TRUE before EDGE_FALSE. But even that will inevitably cause issues like this bug. A similar thing would be enforcing that EDGE_TRUE is the first outgoing edge and EDGE_FALSE the second. But then this is more about visitation order and this part of CFG cleanup just walks over all blocks in block order.