Commit 7fa96708 by Richard Kenner Committed by Richard Kenner

expr.c (store_constructor): Properly compute displacement and alignment when offset is variable.

	* expr.c (store_constructor): Properly compute displacement and
	alignment when offset is variable.

From-SVN: r32837
parent 0e805f81
Thu Mar 30 06:32:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Thu Mar 30 06:32:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_constructor): Properly compute displacement and
alignment when offset is variable.
* expmed.c (store_bit_field, store_fixed_bit_field): Fix more * expmed.c (store_bit_field, store_fixed_bit_field): Fix more
cases of alignment in bytes. cases of alignment in bytes.
......
...@@ -4244,12 +4244,9 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4244,12 +4244,9 @@ store_constructor (exp, target, align, cleared, size)
rtx offset_rtx; rtx offset_rtx;
if (contains_placeholder_p (offset)) if (contains_placeholder_p (offset))
offset = build (WITH_RECORD_EXPR, bitsizetype, offset = build (WITH_RECORD_EXPR, sizetype,
offset, make_tree (TREE_TYPE (exp), target)); offset, make_tree (TREE_TYPE (exp), target));
offset = size_binop (EXACT_DIV_EXPR, offset, bitsize_unit_node);
offset = convert (sizetype, offset);
offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0); offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
if (GET_CODE (to_rtx) != MEM) if (GET_CODE (to_rtx) != MEM)
abort (); abort ();
...@@ -4268,6 +4265,7 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4268,6 +4265,7 @@ store_constructor (exp, target, align, cleared, size)
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0), gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
force_reg (ptr_mode, force_reg (ptr_mode,
offset_rtx))); offset_rtx)));
align = DECL_OFFSET_ALIGN (field);
} }
if (TREE_READONLY (field)) if (TREE_READONLY (field))
...@@ -4306,10 +4304,7 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4306,10 +4304,7 @@ store_constructor (exp, target, align, cleared, size)
} }
#endif #endif
store_constructor_field (to_rtx, bitsize, bitpos, mode, store_constructor_field (to_rtx, bitsize, bitpos, mode,
TREE_VALUE (elt), type, TREE_VALUE (elt), type, align, cleared);
MIN (align,
DECL_ALIGN (TREE_PURPOSE (elt))),
cleared);
} }
} }
else if (TREE_CODE (type) == ARRAY_TYPE) else if (TREE_CODE (type) == ARRAY_TYPE)
......
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