cse.c (cse_insn): Fix thinko in the canonicalization of USE insns.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 13 Oct 2010 18:18:36 +0000 (18:18 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 13 Oct 2010 18:18:36 +0000 (18:18 +0000)
* cse.c (cse_insn): Fix thinko in the canonicalization of USE insns.
Canonicalize input operands of ASM_OPERANDS insns.

From-SVN: r165429

gcc/ChangeLog
gcc/cse.c

index a2979ca..7a434ac 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * cse.c (cse_insn): Fix thinko in the canonicalization of USE insns.
+       Canonicalize input operands of ASM_OPERANDS insns.
+
 2010-10-13  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45788
index 6adb799..4d10c84 100644 (file)
--- 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.  */