http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53791
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-06-28 Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-28 09:51:48 UTC --- Confirmed. tree-ssa-ifcombine.c deals with two-comparison CFG patterns, so it could handle transforming # BLOCK 4 freq:9688 count:93 # PRED: 3 [96.9%] count:93 (false,exec) if (xD.1241_2(D) == 2) goto <bb 7>; else goto <bb 5>; # SUCC: 7 [3.2%] count:3 (true,exec) 5 [96.8%] count:90 (false,exec) # BLOCK 5 freq:9375 count:90 # PRED: 4 [96.8%] count:90 (false,exec) if (xD.1241_2(D) == 3) goto <bb 7>; else goto <bb 6>; at least (and by iterating would then catch the 2nd opportunity). That's of course somewhat ad-hoc (but the easiest place to implement). The other trivially obvious possibility is to pattern-match this open-coded switch/case and transform it back to switch/case early.