From: Vladimir Makarov Date: Fri, 23 Nov 2018 22:00:43 +0000 (+0000) Subject: re PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=795a6c676ae5f39d2b9e5e6bca2baed204b7a1f1;p=gcc.git re PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385) 2018-11-23 Vladimir Makarov PR bootstrap/88157 * ira-costs.c (record_operand_costs): Use bigger hard reg class if its mode does not fit to the original class. From-SVN: r266422 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c377aa534dd..b0b85bac352 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-23 Vladimir Makarov + + 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 PR tree-optimization/87756 diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 6c1d9ddde56..cfda4322bc3 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1319,6 +1319,13 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) 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--) {