i386.c (ix86_decompose_address): Use simplify_gen_subreg for all addresses, zero...
authorUros Bizjak <ubizjak@gmail.com>
Mon, 29 Oct 2012 16:41:41 +0000 (17:41 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 29 Oct 2012 16:41:41 +0000 (17:41 +0100)
* config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
for all addresses, zero-extended with AND.

From-SVN: r192950

gcc/ChangeLog
gcc/config/i386/i386.c

index cf534c6..b0a8354 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-29  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_decompose_address): Use simplify_gen_subreg
+       for all addresses, zero-extended with AND.
+
 2012-10-29  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR middle-end/55116
index 2931e62..e0994e7 100644 (file)
@@ -11810,23 +11810,11 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
       else if (GET_CODE (addr) == AND
               && const_32bit_mask (XEXP (addr, 1), DImode))
        {
-         addr = XEXP (addr, 0);
+         addr = simplify_gen_subreg (SImode, XEXP (addr, 0), DImode, 0);
+         if (addr == NULL_RTX)
+           return 0;
 
-         /* Adjust SUBREGs.  */
-         if (GET_CODE (addr) == SUBREG
-             && GET_MODE (SUBREG_REG (addr)) == SImode)
-           {
-             addr = SUBREG_REG (addr);
-             if (CONST_INT_P (addr))
-               return 0;
-           }
-         else if (GET_MODE (addr) == DImode)
-           {
-             addr = simplify_gen_subreg (SImode, addr, DImode, 0);
-             if (addr == NULL_RTX)
-               return 0;
-           }
-         else if (GET_MODE (addr) != VOIDmode)
+         if (CONST_INT_P (addr))
            return 0;
        }
     }