https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118992
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to H.J. Lu from comment #4) > (In reply to H.J. Lu from comment #3) > > The cse1 pass works on aarch64, but not on x86-64. > > It is the fwprop1 pass, not the cse1 pass. It is due to hash_rtx in cse.cc: if (regno >= FIRST_PSEUDO_REGISTER) record = true; else if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx || x == arg_pointer_rtx || x == stack_pointer_rtx || x == pic_offset_table_rtx) record = true; else if (global_regs[regno]) record = false; else if (fixed_regs[regno]) record = true; else if (GET_MODE_CLASS (GET_MODE (x)) == MODE_CC) record = true; else if (targetm.small_register_classes_for_mode_p (GET_MODE (x))) record = false; else if (targetm.class_likely_spilled_p (REGNO_REG_CLASS (regno))) record = false; else record = true; if (!record) { *do_not_record_p = 1; return 0; } If record is true, it works.