aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expr.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c0175c..88d54ea 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 3 14:56:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (expand_expr, case COMPONENT_REF): Use bitfield case if
+ result is a RECORD_TYPE.
+
2000-03-03 Jonathan Larmour <jlarmour@cygnus.co.uk>
* config/mips/elf.h (CTOR_LISTS_DEFINED_EXTERNALLY): Added.
diff --git a/gcc/expr.c b/gcc/expr.c
index b0d1e07..fb266e2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6756,7 +6756,17 @@ expand_expr (exp, target, tmode, modifier)
&& SLOW_UNALIGNED_ACCESS (mode1, alignment)
&& ((TYPE_ALIGN (TREE_TYPE (tem))
< (unsigned int) GET_MODE_ALIGNMENT (mode))
- || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)))))
+ || (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,
+ we must use bitfield operations. */
+ || ((bitsize >= 0
+ && (TREE_CODE (TYPE_SIZE (TREE_TYPE (exp)))
+ == INTEGER_CST)
+ && ((TREE_INT_CST_HIGH (TYPE_SIZE (TREE_TYPE (exp)))
+ != 0)
+ || (TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp)))
+ != bitsize))))))
|| (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER
&& mode == BLKmode