cse.c (canon_asm_operands): New function extracted from...

* cse.c (canon_asm_operands): New function extracted from...
	(canonicalize_insn): ...here.  Call it to canonicalize an ASM_OPERANDS
	either standalone or member of a PARALLEL.

From-SVN: r237642
This commit is contained in:
Eric Botcazou 2016-06-21 10:52:57 +00:00 committed by Eric Botcazou
parent e9305990d9
commit 6380a82ebe
2 changed files with 25 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2016-06-21 Eric Botcazou <ebotcazou@adacore.com>
* cse.c (canon_asm_operands): New function extracted from...
(canonicalize_insn): ...here. Call it to canonicalize an ASM_OPERANDS
either standalone or member of a PARALLEL.
2016-06-21 Georg-Johann Lay <avr@gjlay.de>
PR target/30417

View file

@ -4298,6 +4298,22 @@ find_sets_in_insn (rtx_insn *insn, struct set **psets)
return n_sets;
}
/* Subroutine of canonicalize_insn. X is an ASM_OPERANDS in INSN. */
static void
canon_asm_operands (rtx x, rtx_insn *insn)
{
for (int i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
{
rtx input = ASM_OPERANDS_INPUT (x, i);
if (!(REG_P (input) && HARD_REGISTER_P (input)))
{
input = canon_reg (input, insn);
validate_change (insn, &ASM_OPERANDS_INPUT (x, i), input, 1);
}
}
}
/* Where possible, substitute every register reference in the N_SETS
number of SETS in INSN with the canonical register.
@ -4361,17 +4377,7 @@ canonicalize_insn (rtx_insn *insn, struct set **psets, int n_sets)
/* Canonicalize a USE of a pseudo register or memory location. */
canon_reg (x, insn);
else if (GET_CODE (x) == ASM_OPERANDS)
{
for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
{
rtx input = ASM_OPERANDS_INPUT (x, i);
if (!(REG_P (input) && REGNO (input) < FIRST_PSEUDO_REGISTER))
{
input = canon_reg (input, insn);
validate_change (insn, &ASM_OPERANDS_INPUT (x, i), input, 1);
}
}
}
canon_asm_operands (x, insn);
else if (GET_CODE (x) == CALL)
{
canon_reg (x, insn);
@ -4400,6 +4406,8 @@ canonicalize_insn (rtx_insn *insn, struct set **psets, int n_sets)
&& ! (REG_P (XEXP (y, 0))
&& REGNO (XEXP (y, 0)) < FIRST_PSEUDO_REGISTER))
canon_reg (y, insn);
else if (GET_CODE (y) == ASM_OPERANDS)
canon_asm_operands (y, insn);
else if (GET_CODE (y) == CALL)
{
canon_reg (y, insn);