https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101139
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > if (b_13 < h.0_15) > goto <bb 4>; [51.12%] > else > goto <bb 5>; [48.88%] > > <bb 4> [local count: 548896825]: > _16 = (short unsigned int) f$ab_14; > _17 = (int) _16; > _18 = __builtin_bswap16 (_17); > goto <bb 6>; [100.00%] > > <bb 5> [local count: 524845000]: > k_22 = i (); > c.1_23 = (short unsigned int) k_22; > _24 = (int) c.1_23; > _25 = __builtin_bswap16 (_24); > > <bb 6> [local count: 1073741824]: > # prephitmp_32 = PHI <_18(4), _25(5)> > > Basically the same issue as PR 13563. Once that issue is fixed we should get: if (b_13 < h.0_15) goto <bb 4>; [51.12%] else goto <bb 5>; [48.88%] <bb 4> [local count: 548896825]: _16 = (short unsigned int) f$ab_14; goto <bb 6>; [100.00%] <bb 5> [local count: 524845000]: k_22 = i (); c.1_23 = (short unsigned int) k_22; <bb 6> [local count: 1073741824]: # c.1_23 = PHI <_16(4), c.1_23(5)> _24 = (int) c.1_23; prephitmp_32 = __builtin_bswap16 (_32); _2 = (int) prephitmp_32; _3 = __builtin_bswap16 (_2); _4 = (int) _3; Which then should just optimize later on to: if (b_13 < h.0_15) goto <bb 4>; [51.12%] else goto <bb 5>; [48.88%] <bb 4> [local count: 548896825]: _16 = (short unsigned int) f$ab_14; goto <bb 6>; [100.00%] <bb 5> [local count: 524845000]: k_22 = i (); c.1_23 = (short unsigned int) k_22; <bb 6> [local count: 1073741824]: # c.1_23 = PHI <_16(4), c.1_23(5)> _24 = (int) c.1_23; _4 = _24; (If I did this conversion right)