expmed.c (store_bit_field): Don't search for an integer mode unless we need the result.
authorRichard Sandiford <rsandifo@redhat.com>
Fri, 26 Sep 2003 13:28:45 +0000 (13:28 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 26 Sep 2003 13:28:45 +0000 (13:28 +0000)
* expmed.c (store_bit_field): Don't search for an integer mode
unless we need the result.

From-SVN: r71819

gcc/ChangeLog
gcc/expmed.c

index 534e99b493a94079d000d01cbca380c5897746be..5929dca61b9f65fadee9b9cb4fcd717b404ec7c3 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-26  Richard Sandiford  <rsandifo@redhat.com>
+
+       * expmed.c (store_bit_field): Don't search for an integer mode
+       unless we need the result.
+
 2003-09-26  Richard Sandiford  <rsandifo@redhat.com>
 
        * expr.c (emit_move_insn_1): If there is no move pattern for the
index 6acc8956e267ecafebb081923e164c32fd27f7eb..d93be934be3baf3cdfdc80187c86fca315e7ec25 100644 (file)
@@ -461,7 +461,9 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
         VOIDmode, because that is what store_field uses to indicate that this
         is a bit field, but passing VOIDmode to operand_subword_force will
         result in an abort.  */
-      fieldmode = smallest_mode_for_size (nwords * BITS_PER_WORD, MODE_INT);
+      fieldmode = GET_MODE (value);
+      if (fieldmode == VOIDmode)
+       fieldmode = smallest_mode_for_size (nwords * BITS_PER_WORD, MODE_INT);
 
       for (i = 0; i < nwords; i++)
        {
@@ -477,10 +479,7 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
          store_bit_field (op0, MIN (BITS_PER_WORD,
                                     bitsize - i * BITS_PER_WORD),
                           bitnum + bit_offset, word_mode,
-                          operand_subword_force (value, wordnum,
-                                                 (GET_MODE (value) == VOIDmode
-                                                  ? fieldmode
-                                                  : GET_MODE (value))),
+                          operand_subword_force (value, wordnum, fieldmode),
                           total_size);
        }
       return value;