expr.c (store_constructor_field): If bit position is not multiple of alignment of...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Mon, 29 Nov 1999 22:44:52 +0000 (22:44 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 29 Nov 1999 22:44:52 +0000 (17:44 -0500)
* expr.c (store_constructor_field): If bit position is not multiple
of alignment of TARGET's mode, use BLKmode.

From-SVN: r30713

gcc/ChangeLog
gcc/expr.c

index beae01eba7504b6eb408748f1d70d38628a5f9b1..86b451e1eba14336692cad7d444d06ad39e8a1cf 100644 (file)
@@ -1,5 +1,8 @@
 Mon Nov 29 16:56:42 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * expr.c (store_constructor_field): If bit position is not multiple
+       of alignment of TARGET's mode, use BLKmode.
+
        * expr.c (expand_expr_unaligned): Add more code from full case
        that is needed when OP0 is in a register.
 
index bc6c93fb2bb4ea79ccae9af79f1c3a48dc833f4d..91a78e388cfc076139115cb78c3885f8daabade5 100644 (file)
@@ -4040,9 +4040,14 @@ store_constructor_field (target, bitsize, bitpos,
       && (bitpos == 0 || GET_CODE (target) == MEM))
     {
       if (bitpos != 0)
-       target = change_address (target, VOIDmode,
-                                plus_constant (XEXP (target, 0),
-                                               bitpos / BITS_PER_UNIT));
+       target
+         = change_address (target,
+                           GET_MODE (target) == BLKmode
+                           || 0 != (bitpos
+                                    % GET_MODE_ALIGNMENT (GET_MODE (target)))
+                           ? BLKmode : VOIDmode,
+                           plus_constant (XEXP (target, 0),
+                                          bitpos / BITS_PER_UNIT));
       store_constructor (exp, target, align, cleared);
     }
   else