https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103300
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to hubicka from comment #2) > Needs -O2 -floop-unroll-and-jam --param early-inlining-insns=14 > to fail, so I guess it may be issue with unrol-and-jam. The major difference I see between GCC 11 and GCC 12 is how tree-loop-im handles the load/store of a and c. In GCC 11, it was an unconditional move of the store of a and c while in GCC 12 we get some interesting branches: <bb 9> [local count: 35059055]: # a_lsm.21_25 = PHI <_20(D)(6), _15(8)> # a_lsm_flag.22_8 = PHI <0(6), 1(8)> # c_lsm.23_22 = PHI <0(6), _5(8)> if (c_lsm.23_22 <= 2) goto <bb 17>; [94.50%] else goto <bb 10>; [5.50%] <bb 10> [local count: 1928248]: # a_lsm_flag.22_14 = PHI <a_lsm_flag.22_8(9)> # a_lsm.21_28 = PHI <a_lsm.21_25(9)> c_lsm.23_27 = 3; if (a_lsm_flag.22_14 != 0) goto <bb 11>; [66.67%] else goto <bb 12>; [33.33%] <bb 11> [local count: 1285499]: c = c_lsm.23_27; <bb 12> [local count: 1285499]: if (a_lsm_flag.22_14 != 0) goto <bb 13>; [66.67%] else goto <bb 14>; [33.33%] <bb 13> [local count: 856999]: a = a_lsm.21_28; <bb 14> [local count: 1928248]: