https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79411
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Seems it is reassoc1 that transforms: @@ -48,7 +69,6 @@ foo (struct C * x, const int * y, unsign ;; basic block 5, loop depth 0 ;; pred: 3 - _2 = d_1(ab) + 1; _3 = x_25(D)->c1; if (_3 != 0) goto <bb 7>; [50.00%] @@ -81,7 +101,7 @@ foo (struct C * x, const int * y, unsign ;; pred: 7 _5 = e_27(D) == 0; _6 = d_1(ab) > 7; - _7 = _5 | _6; + _7 = _6 | _5; if (_7 != 0) goto <bb 10>; [50.00%] else @@ -155,7 +175,7 @@ foo (struct C * x, const int * y, unsign ;; basic block 16, loop depth 0 ;; pred: 15 - _11 = _2 + 1; + _11 = d_1(ab) + 2; *z_29(D) = _11; ;; succ: 17 which is not valid, because while in bb5 d_1(ab) is the current SSA_NAME of d, in bb16 it is d_13(ab), so it can't be propagated. Looking into it.