expr.c (store_expr): When converting a CONST_INT for storage in a SUBREG...
authorRichard Henderson <rth@redhat.com>
Mon, 8 Oct 2001 16:54:45 +0000 (09:54 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 8 Oct 2001 16:54:45 +0000 (09:54 -0700)
        * expr.c (store_expr): When converting a CONST_INT for storage
        in a SUBREG, convert it to both SUBREG modes before stripping
        the SUBREG.

From-SVN: r46081

gcc/ChangeLog
gcc/expr.c

index 182fd9c931dbeceaa9c511bad9b51919b737b639..f9f029800fbf48e2e724630bb895b6234ebecdb6 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-08  Richard Henderson  <rth@redhat.com>
+
+       * expr.c (store_expr): When converting a CONST_INT for storage
+       in a SUBREG, convert it to both SUBREG modes before stripping
+       the SUBREG.
+
 2001-10-08  Richard Henderson  <rth@redhat.com>
 
        * varasm.c (restore_varasm_status): New.
index 52f9cc0f2e002893f33c95b895d285695f816f23..130b3e1195d7df2f6d98cce6131284e3ce87a1c9 100644 (file)
@@ -4152,9 +4152,13 @@ store_expr (exp, target, want_value)
       /* If TEMP is a VOIDmode constant, use convert_modes to make
         sure that we properly convert it.  */
       if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode)
-       temp = convert_modes (GET_MODE (SUBREG_REG (target)),
-                             TYPE_MODE (TREE_TYPE (exp)), temp,
-                             SUBREG_PROMOTED_UNSIGNED_P (target));
+       {
+         temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
+                               temp, SUBREG_PROMOTED_UNSIGNED_P (target));
+         temp = convert_modes (GET_MODE (SUBREG_REG (target)),
+                               GET_MODE (target), temp,
+                               SUBREG_PROMOTED_UNSIGNED_P (target));
+       }
 
       convert_move (SUBREG_REG (target), temp,
                    SUBREG_PROMOTED_UNSIGNED_P (target));