The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88157
The patch was successfully bootstrapped on x86 and x86-64 with GO and D. Committed as rev. 266422.
Index: ChangeLog =================================================================== --- ChangeLog (revision 266421) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2018-11-23 Vladimir Makarov <vmaka...@redhat.com> + + PR bootstrap/88157 + * ira-costs.c (record_operand_costs): Use bigger hard reg class if + its mode does not fit to the original class. + 2018-11-23 Martin Sebor <mse...@redhat.com> PR tree-optimization/87756 Index: ira-costs.c =================================================================== --- ira-costs.c (revision 266385) +++ ira-costs.c (working copy) @@ -1319,6 +1319,13 @@ record_operand_costs (rtx_insn *insn, en bool dead_p = find_regno_note (insn, REG_DEAD, REGNO (src)); hard_reg_class = REGNO_REG_CLASS (other_regno); + /* Target code may return any cost for mode which does not + fit the the hard reg class (e.g. DImode for AREG on + i386). Check this and use a bigger class to get the + right cost. */ + if (! ira_hard_reg_in_set_p (other_regno, mode, + reg_class_contents[hard_reg_class])) + hard_reg_class = ira_pressure_class_translate[hard_reg_class]; i = regno == (int) REGNO (src) ? 1 : 0; for (k = cost_classes_ptr->num - 1; k >= 0; k--) {