Commit b7010412 by Richard Kenner Committed by Richard Kenner

expr.c (store_constructor): New argument SIZE; pass to clear_storage.

	* expr.c (store_constructor): New argument SIZE; pass to clear_storage.
	(store_constructor_field, expand_expr): Pass new arg.

From-SVN: r31037
parent 11a6092b
Mon Dec 20 15:00:04 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_constructor): New argument SIZE; pass to clear_storage.
(store_constructor_field, expand_expr): Pass new arg.
1999-12-20 Mark Mitchell <mark@codesourcery.com> 1999-12-20 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (explow.o): Depend on function.h. * Makefile.in (explow.o): Depend on function.h.
......
...@@ -145,7 +145,7 @@ static int is_zeros_p PROTO((tree)); ...@@ -145,7 +145,7 @@ static int is_zeros_p PROTO((tree));
static int mostly_zeros_p PROTO((tree)); static int mostly_zeros_p PROTO((tree));
static void store_constructor_field PROTO((rtx, int, int, enum machine_mode, static void store_constructor_field PROTO((rtx, int, int, enum machine_mode,
tree, tree, int, int)); tree, tree, int, int));
static void store_constructor PROTO((tree, rtx, int, int)); static void store_constructor PROTO((tree, rtx, int, int, int));
static rtx store_field PROTO((rtx, int, int, enum machine_mode, tree, static rtx store_field PROTO((rtx, int, int, enum machine_mode, tree,
enum machine_mode, int, int, enum machine_mode, int, int,
int, int)); int, int));
...@@ -4074,7 +4074,7 @@ store_constructor_field (target, bitsize, bitpos, ...@@ -4074,7 +4074,7 @@ store_constructor_field (target, bitsize, bitpos,
? BLKmode : VOIDmode, ? BLKmode : VOIDmode,
plus_constant (XEXP (target, 0), plus_constant (XEXP (target, 0),
bitpos / BITS_PER_UNIT)); bitpos / BITS_PER_UNIT));
store_constructor (exp, target, align, cleared); store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT);
} }
else else
store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0, store_field (target, bitsize, bitpos, mode, exp, VOIDmode, 0,
...@@ -4085,14 +4085,18 @@ store_constructor_field (target, bitsize, bitpos, ...@@ -4085,14 +4085,18 @@ store_constructor_field (target, bitsize, bitpos,
/* Store the value of constructor EXP into the rtx TARGET. /* Store the value of constructor EXP into the rtx TARGET.
TARGET is either a REG or a MEM. TARGET is either a REG or a MEM.
ALIGN is the maximum known alignment for TARGET, in bits. ALIGN is the maximum known alignment for TARGET, in bits.
CLEARED is true if TARGET is known to have been zero'd. */ CLEARED is true if TARGET is known to have been zero'd.
SIZE is the number of bytes of TARGET we are allowed to modify: this
may not be the same as the size of EXP if we are assigning to a field
which has been packed to exclude padding bits. */
static void static void
store_constructor (exp, target, align, cleared) store_constructor (exp, target, align, cleared, size)
tree exp; tree exp;
rtx target; rtx target;
int align; int align;
int cleared; int cleared;
int size;
{ {
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
#ifdef WORD_REGISTER_OPERATIONS #ifdef WORD_REGISTER_OPERATIONS
...@@ -4107,7 +4111,7 @@ store_constructor (exp, target, align, cleared) ...@@ -4107,7 +4111,7 @@ store_constructor (exp, target, align, cleared)
if (GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER) if (GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER)
{ {
rtx temp = gen_reg_rtx (GET_MODE (target)); rtx temp = gen_reg_rtx (GET_MODE (target));
store_constructor (exp, temp, 0); store_constructor (exp, temp, 0, size);
emit_move_insn (target, temp); emit_move_insn (target, temp);
return; return;
} }
...@@ -4152,7 +4156,7 @@ store_constructor (exp, target, align, cleared) ...@@ -4152,7 +4156,7 @@ store_constructor (exp, target, align, cleared)
|| mostly_zeros_p (exp)) || mostly_zeros_p (exp))
{ {
if (! cleared) if (! cleared)
clear_storage (target, expr_size (exp), clear_storage (target, GEN_INT (size),
(align + BITS_PER_UNIT - 1) / BITS_PER_UNIT); (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT);
cleared = 1; cleared = 1;
...@@ -4338,7 +4342,7 @@ store_constructor (exp, target, align, cleared) ...@@ -4338,7 +4342,7 @@ store_constructor (exp, target, align, cleared)
if (need_to_clear) if (need_to_clear)
{ {
if (! cleared) if (! cleared)
clear_storage (target, expr_size (exp), clear_storage (target, GEN_INT (size),
(align + BITS_PER_UNIT - 1) / BITS_PER_UNIT); (align + BITS_PER_UNIT - 1) / BITS_PER_UNIT);
cleared = 1; cleared = 1;
} }
...@@ -4443,7 +4447,8 @@ store_constructor (exp, target, align, cleared) ...@@ -4443,7 +4447,8 @@ store_constructor (exp, target, align, cleared)
addr = gen_rtx_PLUS (Pmode, XEXP (target, 0), pos_rtx); addr = gen_rtx_PLUS (Pmode, XEXP (target, 0), pos_rtx);
xtarget = change_address (target, mode, addr); xtarget = change_address (target, mode, addr);
if (TREE_CODE (value) == CONSTRUCTOR) if (TREE_CODE (value) == CONSTRUCTOR)
store_constructor (value, xtarget, align, cleared); store_constructor (value, xtarget, align, cleared,
bitsize / BITS_PER_UNIT);
else else
store_expr (value, xtarget, 0); store_expr (value, xtarget, 0);
...@@ -4517,7 +4522,7 @@ store_constructor (exp, target, align, cleared) ...@@ -4517,7 +4522,7 @@ store_constructor (exp, target, align, cleared)
if (elt == NULL_TREE) if (elt == NULL_TREE)
{ {
if (!cleared) if (!cleared)
clear_storage (target, expr_size (exp), clear_storage (target, GEN_INT (size),
TYPE_ALIGN (type) / BITS_PER_UNIT); TYPE_ALIGN (type) / BITS_PER_UNIT);
return; return;
} }
...@@ -6363,7 +6368,8 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6363,7 +6368,8 @@ expand_expr (exp, target, tmode, modifier)
RTX_UNCHANGING_P (target) = 1; RTX_UNCHANGING_P (target) = 1;
} }
store_constructor (exp, target, TYPE_ALIGN (TREE_TYPE (exp)), 0); store_constructor (exp, target, TYPE_ALIGN (TREE_TYPE (exp)), 0,
int_size_in_bytes (TREE_TYPE (exp)));
return target; return target;
} }
......
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