https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25290
--- Comment #29 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #28) > Created attachment 54821 [details] > New set of patches including some other improvements Note this series does not bootstrap, the last patch found that I had a latent bug in the patch that started to handle diamond shaped PHIs. For: if (_16 == 34) goto <bb 10>; [INV] else goto <bb 12>; [INV] <bb 10> : ... _27 = csets__identifier_char[_26]; if (_27 != 0) goto <bb 11>; [INV] else goto <bb 12>; [INV] <bb 11> : // predicted unlikely by early return (on trees) predictor. goto <bb 13>; [INV] <bb 12> : // predicted unlikely by early return (on trees) predictor. <bb 13> : # _28 = PHI <1(7), 0(12), 1(4), 1(11)> I would transform it to use _27 even from bb 12 which is wrong. I had missed that minmax_replacement did: if (!single_pred_p (middle_bb) || !single_pred_p (alt_middle_bb) || !single_succ_p (middle_bb) || !single_succ_p (alt_middle_bb)) return false; I will add that check tomorrow.