Commit eafeba3e by Richard Biener

middle-end/94614 - avoid multiword moves to nothing

This adjusts emit_move_multi_word to handle moves into paradoxical
subregs parts that are not there and adjusts lower-subregs
CLOBBER resolving to deal with those as well.

2020-04-16  Richard Biener  <rguenther@suse.de>

	PR middle-end/94614
	* expr.c (emit_move_multi_word): Do not generate code when
	the destination part is undefined_operand_subword_p.
	* lower-subreg.c (resolve_clobber): Look through a paradoxica
	subreg.
parent 437eea66
2020-04-16 Richard Biener <rguenther@suse.de>
PR middle-end/94614
* expr.c (emit_move_multi_word): Do not generate code when
the destination part is undefined_operand_subword_p.
* lower-subreg.c (resolve_clobber): Look through a paradoxica
subreg.
2020-04-16 Martin Jambor <mjambor@suse.cz> 2020-04-16 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/94598 PR tree-optimization/94598
......
...@@ -3692,6 +3692,11 @@ emit_move_multi_word (machine_mode mode, rtx x, rtx y) ...@@ -3692,6 +3692,11 @@ emit_move_multi_word (machine_mode mode, rtx x, rtx y)
need_clobber = false; need_clobber = false;
for (i = 0; i < CEIL (mode_size, UNITS_PER_WORD); i++) for (i = 0; i < CEIL (mode_size, UNITS_PER_WORD); i++)
{ {
/* Do not generate code for a move if it would go entirely
to the non-existing bits of a paradoxical subreg. */
if (undefined_operand_subword_p (x, i))
continue;
rtx xpart = operand_subword (x, i, 1, mode); rtx xpart = operand_subword (x, i, 1, mode);
rtx ypart; rtx ypart;
......
...@@ -1150,6 +1150,10 @@ resolve_clobber (rtx pat, rtx_insn *insn) ...@@ -1150,6 +1150,10 @@ resolve_clobber (rtx pat, rtx_insn *insn)
int ret; int ret;
reg = XEXP (pat, 0); reg = XEXP (pat, 0);
/* For clobbers we can look through paradoxical subregs which
we do not handle in simplify_gen_subreg_concatn. */
if (paradoxical_subreg_p (reg))
reg = SUBREG_REG (reg);
if (!resolve_reg_p (reg) && !resolve_subreg_p (reg)) if (!resolve_reg_p (reg) && !resolve_subreg_p (reg))
return false; return false;
......
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