expmed.c (store_bit_field): Use int_mode_for_mode to find corresponding mode of non...
authorJ"orn Rennecke <joern.rennecke@superh.com>
Mon, 2 Dec 2002 14:44:17 +0000 (14:44 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 2 Dec 2002 14:44:17 +0000 (14:44 +0000)
* expmed.c (store_bit_field): Use int_mode_for_mode to find
corresponding mode of non-integer mode, unless it is VOIDmode.

From-SVN: r59716

gcc/ChangeLog
gcc/expmed.c

index f09b4dba68793215155bbb0c5431d58e8eb9222c..64558f1047e5702dcff9b58c313804629c67d99c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Dec  2 14:43:22 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * expmed.c (store_bit_field): Use int_mode_for_mode to find
+       corresponding mode of non-integer mode, unless it is VOIDmode.
+
 2002-12-02  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (stm_h8300s_2): New.
index 6b365b9e0ad0f8dbe12ff69e7ed0cba320aa5c44..d1c89f2f1f2edadd042b9f2a0e76dbae97435f17 100644 (file)
@@ -535,7 +535,9 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
      structure fields.  */
   if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT
       && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT)
-    value = gen_lowpart (word_mode, value);
+    value = gen_lowpart ((GET_MODE (value) == VOIDmode
+                         ? word_mode : int_mode_for_mode (GET_MODE (value))),
+                        value);
 
   /* Now OFFSET is nonzero only if OP0 is memory
      and is therefore always measured in bytes.  */