Commit 23ccec44 by Jim Wilson

(store_constructor_field): Add explanatory comment.

Call store_field if bitpos is nonzero and target is not a MEM.

From-SVN: r11503
parent 29e8f73f
...@@ -3261,7 +3261,12 @@ mostly_zeros_p (exp) ...@@ -3261,7 +3261,12 @@ mostly_zeros_p (exp)
/* Helper function for store_constructor. /* Helper function for store_constructor.
TARGET, BITSIZE, BITPOS, MODE, EXP are as for store_field. TARGET, BITSIZE, BITPOS, MODE, EXP are as for store_field.
TYPE is the type of the CONSTRUCTOR, not the element type. 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 static void
store_constructor_field (target, bitsize, bitpos, store_constructor_field (target, bitsize, bitpos,
...@@ -3273,7 +3278,11 @@ store_constructor_field (target, bitsize, bitpos, ...@@ -3273,7 +3278,11 @@ store_constructor_field (target, bitsize, bitpos,
int cleared; int cleared;
{ {
if (TREE_CODE (exp) == CONSTRUCTOR 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) if (bitpos != 0)
target = change_address (target, VOIDmode, target = change_address (target, VOIDmode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment