expr.c (store_field): Force usage of bitfield instructions when the field position...
authorOlivier Hainque <hainque@act-europe.fr>
Wed, 16 Apr 2003 21:30:35 +0000 (23:30 +0200)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 16 Apr 2003 21:30:35 +0000 (17:30 -0400)
        * expr.c (store_field): Force usage of bitfield instructions when
        the field position requires it, whatever SLOW_UNALIGNED_ACCESS.
        (expand_expr, case BIT_FIELD_REF): likewise.

From-SVN: r65701

gcc/ChangeLog
gcc/expr.c

index f95d7026759dc805e81470ac41174013b8da721d..bb692cf621d6bfb04f1b3b9befd8edda9f4182b4 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-16  Olivier Hainque <hainque@act-europe.fr>
+
+        * expr.c (store_field): Force usage of bitfield instructions when
+        the field position requires it, whatever SLOW_UNALIGNED_ACCESS.
+        (expand_expr, case BIT_FIELD_REF): likewise.
+
 2003-04-16  Mark Mitchell  <mark@codesourcery.com>
 
        PR middle-end/8866
index d20342413339a92556564774777c0d7642daa877..abf0875c849a636dbd4697139dae4482186e0176 100644 (file)
@@ -5564,8 +5564,9 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type,
       || GET_CODE (target) == SUBREG
       /* If the field isn't aligned enough to store as an ordinary memref,
         store it as a bit field.  */
-      || (mode != BLKmode && SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (target))
-         && (MEM_ALIGN (target) < GET_MODE_ALIGNMENT (mode)
+      || (mode != BLKmode
+         && ((SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (target))
+              && (MEM_ALIGN (target) < GET_MODE_ALIGNMENT (mode)))
              || bitpos % GET_MODE_ALIGNMENT (mode)))
       /* If the RHS and field are a constant size and the size of the
         RHS isn't the same size as the bitfield, we must use bitfield
@@ -7504,9 +7505,8 @@ expand_expr (exp, target, tmode, modifier)
            /* If the field isn't aligned enough to fetch as a memref,
               fetch it as a bit field.  */
            || (mode1 != BLKmode
-               && SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op0))
-               && ((TYPE_ALIGN (TREE_TYPE (tem))
-                    < GET_MODE_ALIGNMENT (mode))
+               && ((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
+                    && SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op0)))
                    || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)))
            /* If the type and the field are a constant size and the
               size of the type isn't the same size as the bitfield,