diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index cb5ca8bc21b8..d7191dcee3e2 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1310,7 +1310,7 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) machine_mode mode = GET_MODE (SET_SRC (set)); cost_classes_t cost_classes_ptr = regno_cost_classes[regno]; enum reg_class *cost_classes = cost_classes_ptr->classes; - reg_class_t rclass, hard_reg_class, pref_class, bigger_hard_reg_class; + reg_class_t rclass, hard_reg_class, bigger_hard_reg_class; int cost, k; move_table *move_costs; bool dead_p = find_regno_note (insn, REG_DEAD, REGNO (src)); @@ -1336,23 +1336,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) : move_costs[rclass][hard_reg_class]); op_costs[i]->cost[k] = cost * frequency; - /* If we have assigned a class to this allocno in our - first pass, add a cost to this alternative - corresponding to what we would add if this allocno - were not in the appropriate class. */ - if (pref) - { - if ((pref_class = pref[COST_INDEX (regno)]) == NO_REGS) - op_costs[i]->cost[k] - += ((i == 0 ? ira_memory_move_cost[mode][rclass][0] : 0) - + (i == 1 ? ira_memory_move_cost[mode][rclass][1] : 0) - * frequency); - else if (ira_reg_class_intersect[pref_class][rclass] - == NO_REGS) - op_costs[i]->cost[k] - += (move_costs[pref_class][rclass] - * frequency); - } /* If this insn is a single set copying operand 1 to operand 0 and one operand is an allocno with the other a hard reg or an allocno that prefers a hard @@ -1378,9 +1361,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) } op_costs[i]->mem_cost = ira_memory_move_cost[mode][hard_reg_class][i] * frequency; - if (pref && (pref_class = pref[COST_INDEX (regno)]) != NO_REGS) - op_costs[i]->mem_cost - += ira_memory_move_cost[mode][pref_class][i] * frequency; return; } } diff --git a/gcc/testsuite/gcc.target/i386/pr99531.c b/gcc/testsuite/gcc.target/i386/pr99531.c new file mode 100644 index 000000000000..0e1a08b7c77d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99531.c @@ -0,0 +1,7 @@ +/* { dg-do compile { target { x86_64-*-linux* } } } */ +/* { dg-options "-O2" } */ + +int func(int, int, int, int, int, int); +int caller(int a, int b, int c, int d, int e) { return func(0, a, b, c, d, e); } + +/* { dg-final { scan-assembler-not "push" } } */