Commit 198075e1 by Matthew Fortune Committed by Matthew Fortune

Support WORD_REGISTER_OPERATIONS requirements in simplify_operand_subreg

gcc/
	PR target/78660
	* lra-constraints.c (simplify_operand_subreg): Handle
	WORD_REGISTER_OPERATIONS targets.

From-SVN: r245655
parent 888c7050
2017-02-22 Matthew Fortune <matthew.fortune@imgtec.com>
PR target/78660
* lra-constraints.c (simplify_operand_subreg): Handle
WORD_REGISTER_OPERATIONS targets.
2017-02-22 Jakub Jelinek <jakub@redhat.com> 2017-02-22 Jakub Jelinek <jakub@redhat.com>
PR target/70465 PR target/70465
......
...@@ -1541,11 +1541,22 @@ simplify_operand_subreg (int nop, machine_mode reg_mode) ...@@ -1541,11 +1541,22 @@ simplify_operand_subreg (int nop, machine_mode reg_mode)
subregs as we don't substitute such equiv memory (see processing subregs as we don't substitute such equiv memory (see processing
equivalences in function lra_constraints) and because for spilled equivalences in function lra_constraints) and because for spilled
pseudos we allocate stack memory enough for the biggest pseudos we allocate stack memory enough for the biggest
corresponding paradoxical subreg. */ corresponding paradoxical subreg.
if (!(MEM_ALIGN (subst) < GET_MODE_ALIGNMENT (mode)
&& SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (subst))) However, do not blindly simplify a (subreg (mem ...)) for
|| (MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (innermode) WORD_REGISTER_OPERATIONS targets as this may lead to loading junk
&& SLOW_UNALIGNED_ACCESS (innermode, MEM_ALIGN (reg)))) data into a register when the inner is narrower than outer or
missing important data from memory when the inner is wider than
outer. This rule only applies to modes that are no wider than
a word. */
if (!(GET_MODE_PRECISION (mode) != GET_MODE_PRECISION (innermode)
&& GET_MODE_SIZE (mode) <= UNITS_PER_WORD
&& GET_MODE_SIZE (innermode) <= UNITS_PER_WORD
&& WORD_REGISTER_OPERATIONS)
&& (!(MEM_ALIGN (subst) < GET_MODE_ALIGNMENT (mode)
&& SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (subst)))
|| (MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (innermode)
&& SLOW_UNALIGNED_ACCESS (innermode, MEM_ALIGN (reg)))))
return true; return true;
*curr_id->operand_loc[nop] = operand; *curr_id->operand_loc[nop] = operand;
......
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