https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105216
--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> --- (In reply to Hongtao.liu from comment #5) > My bisect shows it's caused by > r12-3876-g4a960d548b7d7d942f316c5295f6d849b74214f5 pre dump before vs after - goto <bb 21>; [11.00%] - - <bb 12> [local count: 105119324]: - pretmp_379 = cols[d_243]; ---- miss optimization here. - - <bb 13> [local count: 955630226]: - # level4_cnt_250 = PHI <level4_cnt_236(20), level4_cnt_242(12)> - # d_252 = PHI <d_98(20), d_243(12)> - # posib_254 = PHI <posib_102(20), posib_244(12)> - # diagl_shifted_255 = PHI <diagl_shifted_103(20), diagl_shifted_184(12)> - # diagr_shifted_256 = PHI <diagr_shifted_104(20), diagr_shifted_185(12)> - # l_rest_257 = PHI <l_rest_115(20), prephitmp_366(12)> - # prephitmp_380 = PHI <prephitmp_378(20), pretmp_379(12)> + goto <bb 19>; [11.00%] + + <bb 12> [local count: 955630226]: + # level4_cnt_250 = PHI <level4_cnt_205(18), level4_cnt_242(11)> + # d_252 = PHI <d_47(18), d_243(11)> + # posib_254 = PHI <posib_27(18), posib_244(11)> + # diagl_shifted_255 = PHI <diagl_shifted_25(18), diagl_shifted_184(11)> + # diagr_shifted_256 = PHI <diagr_shifted_24(18), diagr_shifted_185(11)> + # l_rest_257 = PHI <l_rest_13(18), prephitmp_313(11)> _30 = ~posib_254; _31 = posib_254 + 1; bit_189 = _30 & _31; @@ -1030,15 +1037,16 @@ uint64_t nqueens (uint_fast8_t n) new_diagl_191 = _32 | diagl_shifted_255; _33 = bit_189 >> 1; new_diagr_192 = _33 | diagr_shifted_256; - bit_193 = bit_189 | prephitmp_380; + _34 = cols[d_252]; + bit_193 = _34 | bit_189;