* expr.c (store_expr): When converting a CONST_INT for storage
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 16:54:45 +0000 (16:54 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 16:54:45 +0000 (16:54 +0000)
        in a SUBREG, convert it to both SUBREG modes before stripping
        the SUBREG.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46081 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index 182fd9c..f9f0298 100644 (file)
@@ -1,5 +1,11 @@
 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.
        * function.h: Declare it.
        * function.c (pop_function_context_from): Call it.
index 52f9cc0..130b3e1 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));