From 23ccec44cc5dbdcca16d1e50ea649facf7e466eb Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 8 Mar 1996 13:52:23 -0800 Subject: [PATCH] (store_constructor_field): Add explanatory comment. Call store_field if bitpos is nonzero and target is not a MEM. From-SVN: r11503 --- gcc/expr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/expr.c b/gcc/expr.c index 890946c51b7..f4e2444c4cb 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3261,7 +3261,12 @@ mostly_zeros_p (exp) /* Helper function for store_constructor. TARGET, BITSIZE, BITPOS, MODE, EXP are as for store_field. TYPE is the type of the CONSTRUCTOR, not the element type. - CLEARED is as for store_constructor. */ + CLEARED is as for store_constructor. + + This provides a recursive shortcut back to store_constructor when it isn't + necessary to go through store_field. This is so that we can pass through + the cleared field to let store_constructor know that we may not have to + clear a substructure if the outer structure has already been cleared. */ static void store_constructor_field (target, bitsize, bitpos, @@ -3273,7 +3278,11 @@ store_constructor_field (target, bitsize, bitpos, int cleared; { if (TREE_CODE (exp) == CONSTRUCTOR - && (bitpos % BITS_PER_UNIT) == 0) + && bitpos % BITS_PER_UNIT == 0 + /* If we have a non-zero bitpos for a register target, then we just + let store_field do the bitfield handling. This is unlikely to + generate unnecessary clear instructions anyways. */ + && (bitpos == 0 || GET_CODE (target) == MEM)) { if (bitpos != 0) target = change_address (target, VOIDmode, -- 2.30.2