aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2018-11-23 22:00:43 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2018-11-23 22:00:43 +0000
commit795a6c676ae5f39d2b9e5e6bca2baed204b7a1f1 (patch)
treece8f90a5d21d348f3e3dff327bd737ef5588ef12 /gcc
parent1b8ccb9d55e862b40d978207ee4b44db914acd91 (diff)
downloadgcc-795a6c676ae5f39d2b9e5e6bca2baed204b7a1f1.zip
gcc-795a6c676ae5f39d2b9e5e6bca2baed204b7a1f1.tar.gz
gcc-795a6c676ae5f39d2b9e5e6bca2baed204b7a1f1.tar.bz2
re PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385)
2018-11-23 Vladimir Makarov <vmakarov@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. From-SVN: r266422
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira-costs.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c377aa5..b0b85ba 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-23 Vladimir Makarov <vmakarov@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 <msebor@redhat.com>
PR tree-optimization/87756
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 6c1d9dd..cfda432 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--)
{