lower-subreg.c (can_decompose_p): Check every word of a hard register.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 19 Dec 2011 21:19:13 +0000 (21:19 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 19 Dec 2011 21:19:13 +0000 (21:19 +0000)
gcc/
* lower-subreg.c (can_decompose_p): Check every word of a hard
register.

From-SVN: r182500

gcc/ChangeLog
gcc/lower-subreg.c

index 02c8dce7e3e9a40ac97eb5483f804d5f2c923b9f..37509933734066d32cd3686101ba8f8d82234e70 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-19  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * lower-subreg.c (can_decompose_p): Check every word of a hard
+       register.
+
 2011-12-19  Sandra Loosemore  <sandra@codesourcery.com>
            Tom de Vries <tom@codesourcery.com>
 
index 85aa29891bf22df9833c7b7dc455680b2f140ec4..779cc5f40dee428177841db44b5c17e23796506b 100644 (file)
@@ -634,8 +634,15 @@ can_decompose_p (rtx x)
       unsigned int regno = REGNO (x);
 
       if (HARD_REGISTER_NUM_P (regno))
-       return (validate_subreg (word_mode, GET_MODE (x), x, UNITS_PER_WORD)
-               && HARD_REGNO_MODE_OK (regno, word_mode));
+       {
+         unsigned int byte, num_bytes;
+
+         num_bytes = GET_MODE_SIZE (GET_MODE (x));
+         for (byte = 0; byte < num_bytes; byte += UNITS_PER_WORD)
+           if (simplify_subreg_regno (regno, GET_MODE (x), byte, word_mode) < 0)
+             return false;
+         return true;
+       }
       else
        return !bitmap_bit_p (subreg_context, regno);
     }