OSDN Git Service

2001-07-03 Andrew Haley <aph@redhat.com>
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2001 15:25:34 +0000 (15:25 +0000)
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2001 15:25:34 +0000 (15:25 +0000)
        * expmed.c (store_fixed_bit_field): Don't use a mode bigger than
        the mode of the memory location.

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

gcc/ChangeLog
gcc/expmed.c

index 8e52cfc..9481d68 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-03  Andrew Haley  <aph@redhat.com>
+
+       * expmed.c (store_fixed_bit_field): Don't use a mode bigger than
+       the mode of the memory location.
+
 2001-07-09  Bo Thorsen  <bo@suse.co.uk>
 
        * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support.
index 0a9b41c..d334f6d 100644 (file)
@@ -673,10 +673,15 @@ store_fixed_bit_field (op0, offset, bitsize, bitpos, value, struct_align)
     {
       /* Get the proper mode to use for this field.  We want a mode that
         includes the entire field.  If such a mode would be larger than
-        a word, we won't be doing the extraction the normal way.  */
+        a word, we won't be doing the extraction the normal way.  
+        We don't want a mode bigger than the destination.  */
 
+      mode = GET_MODE (op0);
+      if (GET_MODE_BITSIZE (mode) == 0
+          || GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (word_mode))
+        mode = word_mode;
       mode = get_best_mode (bitsize, bitpos + offset * BITS_PER_UNIT,
-                           struct_align, word_mode,
+                           struct_align, mode,
                            GET_CODE (op0) == MEM && MEM_VOLATILE_P (op0));
 
       if (mode == VOIDmode)