diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1996-03-08 13:52:23 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1996-03-08 13:52:23 -0800 |
commit | 23ccec44cc5dbdcca16d1e50ea649facf7e466eb (patch) | |
tree | c9c34bfb875b01459b86d03fd14de41c5f94e421 | |
parent | 29e8f73f36eb5b6facbeef366f22fb7f8e19908d (diff) | |
download | gcc-23ccec44cc5dbdcca16d1e50ea649facf7e466eb.zip gcc-23ccec44cc5dbdcca16d1e50ea649facf7e466eb.tar.gz gcc-23ccec44cc5dbdcca16d1e50ea649facf7e466eb.tar.bz2 |
(store_constructor_field): Add explanatory comment.
Call store_field if bitpos is nonzero and target is not a MEM.
From-SVN: r11503
-rw-r--r-- | gcc/expr.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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, |