Commit 2fe8dfe8 by Oleg Endo

re PR target/68277 ([SH]: error: insn does not satisfy its constraints when compiling erlang)

gcc/
	PR target/68277
	* config/sh/sh.md (addsi3_scr): Handle reg overlap of operands[0] and
	operands[2].
	(*addsi3): Add another insn_and_split variant for reload.

Co-Authored-By: Kaz Kojima <kkojima@gcc.gnu.org>

From-SVN: r230425
parent 0d334e37
2015-11-16 Oleg Endo <olegendo@gcc.gnu.org>
Kaz Kojima <kkojima@gcc.gnu.org>
PR target/68277
* config/sh/sh.md (addsi3_scr): Handle reg overlap of operands[0] and
operands[2].
(*addsi3): Add another insn_and_split variant for reload.
2015-11-16 Richard Biener <rguenther@suse.de>
PR middle-end/68117
......@@ -2232,10 +2232,50 @@
}
}
else if (!reg_overlap_mentioned_p (operands[0], operands[1]))
emit_move_insn (operands[0], operands[1]);
{
if (!reg_overlap_mentioned_p (operands[0], operands[2]))
emit_move_insn (operands[0], operands[1]);
else
operands[2] = operands[1];
}
}
[(set_attr "type" "arith")])
;; Old reload might generate add insns directly (not through the expander) for
;; the memory address of complex insns like atomic insns when reloading.
(define_insn_and_split "*addsi3"
[(set (match_operand:SI 0 "arith_reg_dest" "=r")
(plus:SI (match_operand:SI 1 "arith_reg_operand" "r")
(match_operand:SI 2 "arith_or_int_operand" "rn")))]
"TARGET_SH1 && !sh_lra_p ()
&& reload_completed
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
"#"
"&& 1"
[(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
{
if (operands[2] == const0_rtx)
{
emit_move_insn (operands[0], operands[1]);
DONE;
}
if (CONST_INT_P (operands[2]))
{
if (satisfies_constraint_I08 (operands[2]))
emit_move_insn (operands[0], operands[1]);
else
{
emit_move_insn (operands[0], operands[2]);
operands[2] = operands[1];
}
}
else if (!reg_overlap_mentioned_p (operands[0], operands[2]))
emit_move_insn (operands[0], operands[1]);
else
operands[2] = operands[1];
})
(define_insn_and_split "*addsi3"
[(set (match_operand:SI 0 "arith_reg_dest" "=r,r")
(plus:SI (match_operand:SI 1 "arith_reg_operand" "%0,r")
......
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