diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2018-11-28 20:08:03 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2018-11-28 20:08:03 +0000 |
commit | 6d078c9ad5888c7e581790cd8ce16462fa7d7f14 (patch) | |
tree | 51e97442f20b68335e3716da5d64773be1750ed8 /gcc | |
parent | bdd0bd5c96a1f3a51bcfe0cc5b0ffd3ff6f0280e (diff) | |
download | gcc-6d078c9ad5888c7e581790cd8ce16462fa7d7f14.zip gcc-6d078c9ad5888c7e581790cd8ce16462fa7d7f14.tar.gz gcc-6d078c9ad5888c7e581790cd8ce16462fa7d7f14.tar.bz2 |
re PR target/88207 (gcc.target/i386/pr22076.c etc. FAIL)
2018-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/88207
* ira-costs.c (scan_one_insn): Process subregs when updating costs
for pseudos and allocnos from insn.
From-SVN: r266582
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ira-costs.c | 64 |
2 files changed, 40 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dcfad06..f2e5d82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-28 Vladimir Makarov <vmakarov@redhat.com> + + PR target/88207 + * ira-costs.c (scan_one_insn): Process subregs when updating costs + for pseudos and allocnos from insn. + 2018-11-28 David Edelsohn <dje.gcc@gmail.com> * config/rs6000/aix72.h: Update to match aix71.h changes. diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 83dfdcd..e6d0687 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1535,36 +1535,40 @@ scan_one_insn (rtx_insn *insn) /* Now add the cost for each operand to the total costs for its allocno. */ for (i = 0; i < recog_data.n_operands; i++) - if (REG_P (recog_data.operand[i]) - && REGNO (recog_data.operand[i]) >= FIRST_PSEUDO_REGISTER) - { - int regno = REGNO (recog_data.operand[i]); - struct costs *p = COSTS (costs, COST_INDEX (regno)); - struct costs *q = op_costs[i]; - int *p_costs = p->cost, *q_costs = q->cost; - cost_classes_t cost_classes_ptr = regno_cost_classes[regno]; - int add_cost; - - /* If the already accounted for the memory "cost" above, don't - do so again. */ - if (!counted_mem) - { - add_cost = q->mem_cost; - if (add_cost > 0 && INT_MAX - add_cost < p->mem_cost) - p->mem_cost = INT_MAX; - else - p->mem_cost += add_cost; - } - for (k = cost_classes_ptr->num - 1; k >= 0; k--) - { - add_cost = q_costs[k]; - if (add_cost > 0 && INT_MAX - add_cost < p_costs[k]) - p_costs[k] = INT_MAX; - else - p_costs[k] += add_cost; - } - } - + { + rtx op = recog_data.operand[i]; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + if (REG_P (op) && REGNO (op) >= FIRST_PSEUDO_REGISTER) + { + int regno = REGNO (op); + struct costs *p = COSTS (costs, COST_INDEX (regno)); + struct costs *q = op_costs[i]; + int *p_costs = p->cost, *q_costs = q->cost; + cost_classes_t cost_classes_ptr = regno_cost_classes[regno]; + int add_cost; + + /* If the already accounted for the memory "cost" above, don't + do so again. */ + if (!counted_mem) + { + add_cost = q->mem_cost; + if (add_cost > 0 && INT_MAX - add_cost < p->mem_cost) + p->mem_cost = INT_MAX; + else + p->mem_cost += add_cost; + } + for (k = cost_classes_ptr->num - 1; k >= 0; k--) + { + add_cost = q_costs[k]; + if (add_cost > 0 && INT_MAX - add_cost < p_costs[k]) + p_costs[k] = INT_MAX; + else + p_costs[k] += add_cost; + } + } + } return insn; } |