Commit e384094a by Vladimir Makarov Committed by Vladimir Makarov

re PR target/88282 (ICE in df_install_refs at gcc/df-scan.c:2379)

2018-12-06  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/88282
	* ira.c (ira_init_register_move_cost): Use info from
	hard_regno_mode_ok instead of contains_reg_of_mode.
	* ira-costs.c (contains_reg_of_mode): Don't use cost from bigger
	hard register class for some fixed hard registers.

From-SVN: r266862
parent 5da8ebe9
2018-12-06 Vladimir Makarov <vmakarov@redhat.com>
PR target/88282
* ira.c (ira_init_register_move_cost): Use info from
hard_regno_mode_ok instead of contains_reg_of_mode.
* ira-costs.c (contains_reg_of_mode): Don't use cost from bigger
hard register class for some fixed hard registers.
2018-12-06 Segher Boessenkool <segher@kernel.crashing.org> 2018-12-06 Segher Boessenkool <segher@kernel.crashing.org>
* doc/extend.texi (Using Assembly Language with C): Document asm inline. * doc/extend.texi (Using Assembly Language with C): Document asm inline.
...@@ -1323,14 +1323,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) ...@@ -1323,14 +1323,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
move_costs = ira_register_move_cost[mode]; move_costs = ira_register_move_cost[mode];
hard_reg_class = REGNO_REG_CLASS (other_regno); hard_reg_class = REGNO_REG_CLASS (other_regno);
bigger_hard_reg_class = ira_pressure_class_translate[hard_reg_class]; bigger_hard_reg_class = ira_pressure_class_translate[hard_reg_class];
if (bigger_hard_reg_class == NO_REGS
&& (other_regno == STACK_POINTER_REGNUM
#ifdef STATIC_CHAIN_REGNUM
|| other_regno == STATIC_CHAIN_REGNUM
#endif
|| other_regno == FRAME_POINTER_REGNUM
|| other_regno == HARD_FRAME_POINTER_REGNUM))
bigger_hard_reg_class = GENERAL_REGS;
/* Target code may return any cost for mode which does not /* Target code may return any cost for mode which does not
fit the the hard reg class (e.g. DImode for AREG on fit the the hard reg class (e.g. DImode for AREG on
i386). Check this and use a bigger class to get the i386). Check this and use a bigger class to get the
...@@ -1345,17 +1337,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref) ...@@ -1345,17 +1337,6 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
cost = (i == 0 cost = (i == 0
? move_costs[hard_reg_class][rclass] ? move_costs[hard_reg_class][rclass]
: move_costs[rclass][hard_reg_class]); : move_costs[rclass][hard_reg_class]);
/* Target code might define wrong big costs for smaller
reg classes or reg classes containing only fixed hard
regs. Try a bigger class. */
if (bigger_hard_reg_class != hard_reg_class)
{
int cost2 = (i == 0
? move_costs[bigger_hard_reg_class][rclass]
: move_costs[rclass][bigger_hard_reg_class]);
if (cost2 < cost)
cost = cost2;
}
op_costs[i]->cost[k] = cost * frequency; op_costs[i]->cost[k] = cost * frequency;
/* If we have assigned a class to this allocno in our /* If we have assigned a class to this allocno in our
......
...@@ -1573,11 +1573,17 @@ ira_init_register_move_cost (machine_mode mode) ...@@ -1573,11 +1573,17 @@ ira_init_register_move_cost (machine_mode mode)
{ {
static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES]; static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES];
bool all_match = true; bool all_match = true;
unsigned int cl1, cl2; unsigned int i, cl1, cl2;
HARD_REG_SET ok_regs;
ira_assert (ira_register_move_cost[mode] == NULL ira_assert (ira_register_move_cost[mode] == NULL
&& ira_may_move_in_cost[mode] == NULL && ira_may_move_in_cost[mode] == NULL
&& ira_may_move_out_cost[mode] == NULL); && ira_may_move_out_cost[mode] == NULL);
CLEAR_HARD_REG_SET (ok_regs);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (targetm.hard_regno_mode_ok (i, mode))
SET_HARD_REG_BIT (ok_regs, i);
/* Note that we might be asked about the move costs of modes that /* Note that we might be asked about the move costs of modes that
cannot be stored in any hard register, for example if an inline cannot be stored in any hard register, for example if an inline
asm tries to create a register operand with an impossible mode. asm tries to create a register operand with an impossible mode.
...@@ -1586,8 +1592,8 @@ ira_init_register_move_cost (machine_mode mode) ...@@ -1586,8 +1592,8 @@ ira_init_register_move_cost (machine_mode mode)
for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++) for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++)
{ {
int cost; int cost;
if (!contains_reg_of_mode[cl1][mode] if (!hard_reg_set_intersect_p (ok_regs, reg_class_contents[cl1])
|| !contains_reg_of_mode[cl2][mode]) || !hard_reg_set_intersect_p (ok_regs, reg_class_contents[cl2]))
{ {
if ((ira_reg_class_max_nregs[cl1][mode] if ((ira_reg_class_max_nregs[cl1][mode]
> ira_class_hard_regs_num[cl1]) > ira_class_hard_regs_num[cl1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment