https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105513
--- Comment #4 from Hongtao.liu <crazylht at gmail dot com> --- For pattern supports 'm' alternative, mem_cost is frequency which is quite low compared to pp->costs (ira_register_move_cost[mode][rclass][hard_reg_class]) * frequency) For x86 backend even gpr->gpr cost is 2 which should be 2 * frequency in ira_cost, I think we should somehow increase costs for REG_P (op) but choose memory alternative. 928 if (op_class == NO_REGS) 929 /* Although we don't need insn to reload from 930 memory, still accessing memory is usually more 931 expensive than a register. */ 932 pp->mem_cost = frequency;