aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-10-13 18:18:36 +0000
committerEric Botcazou <ebotcazou@adacore.com>2010-10-13 18:18:36 +0000
commitb0e6a5e7e7207004d4fb7b7525cf11a58d1e3709 (patch)
tree7d2875c2390a1a897e97fc4c5055bba42e4890df /gcc/cse.c
parent00d12e67e211fd5613aad3987a5349865b957571 (diff)
* cse.c (cse_insn): Fix thinko in the canonicalization of USE insns.
Canonicalize input operands of ASM_OPERANDS insns. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@165429 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 6adb799d874..4d10c842e0f 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4338,12 +4338,23 @@ cse_insn (rtx insn)
if (MEM_P (XEXP (x, 0)))
canon_reg (XEXP (x, 0), insn);
}
-
/* Canonicalize a USE of a pseudo register or memory location. */
else if (GET_CODE (x) == USE
&& ! (REG_P (XEXP (x, 0))
&& REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER))
- canon_reg (XEXP (x, 0), insn);
+ 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);
+ }
+ }
+ }
else if (GET_CODE (x) == CALL)
{
/* The result of apply_change_group can be ignored; see canon_reg. */