Commit c297a34e by Richard Kenner Committed by Richard Kenner

expr.c (store_field): Ensure ALIGN is no stricter than the alignment of EXP.

	* expr.c (store_field): Ensure ALIGN is no stricter than the
	alignment of EXP.

From-SVN: r31759
parent a7c197f8
Wed Feb 2 08:12:30 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_field): Ensure ALIGN is no stricter than the
alignment of EXP.
2000-02-02 Richard Henderson <rth@cygnus.com> 2000-02-02 Richard Henderson <rth@cygnus.com>
* jump.c (delete_insn): Partially revert 19 Jan change; * jump.c (delete_insn): Partially revert 19 Jan change;
......
...@@ -4817,6 +4817,13 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, ...@@ -4817,6 +4817,13 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
plus_constant (XEXP (target, 0), plus_constant (XEXP (target, 0),
bitpos / BITS_PER_UNIT)); bitpos / BITS_PER_UNIT));
/* Make sure that ALIGN is no stricter than the alignment of
EXP. */
if (TREE_CODE (exp) == VAR_DECL)
align = MIN (DECL_ALIGN (exp) / BITS_PER_UNIT, align);
else
align = MIN (TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT, align);
/* Find an alignment that is consistent with the bit position. */ /* Find an alignment that is consistent with the bit position. */
while ((bitpos % (align * BITS_PER_UNIT)) != 0) while ((bitpos % (align * BITS_PER_UNIT)) != 0)
align >>= 1; align >>= 1;
......
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