https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63442
--- Comment #4 from Jiong Wang <jiwang at gcc dot gnu.org> --- the root cause should be one minor bug in prepare_cmp_insn. the last mode parameter "pmode" of "prepare_cmp_insn" should match the mode of the first parameter "x", while during the recursive call of "prepare_cmp_insn", x is with mode of targetm.libgcc_cmp_return_mode (), pmode is assign to word_mode. there comes the problem, aarch64 implemented libgcc_cmp_return_mode to always return SImode, so there is a unmatch. we should assign pmode with targetm.libgcc_cmp_return_mode () also. this problem is hidding because nearly all other targets use the default hook which return word_mode.