mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-02 09:49:50 +08:00
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
This commit is contained in:
parent
0e805f815e
commit
7fa9670848
@ -1,5 +1,8 @@
|
||||
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
|
||||
cases of alignment in bytes.
|
||||
|
||||
|
11
gcc/expr.c
11
gcc/expr.c
@ -4244,12 +4244,9 @@ store_constructor (exp, target, align, cleared, size)
|
||||
rtx offset_rtx;
|
||||
|
||||
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 = size_binop (EXACT_DIV_EXPR, offset, bitsize_unit_node);
|
||||
offset = convert (sizetype, offset);
|
||||
|
||||
offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
|
||||
if (GET_CODE (to_rtx) != MEM)
|
||||
abort ();
|
||||
@ -4268,6 +4265,7 @@ store_constructor (exp, target, align, cleared, size)
|
||||
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
|
||||
force_reg (ptr_mode,
|
||||
offset_rtx)));
|
||||
align = DECL_OFFSET_ALIGN (field);
|
||||
}
|
||||
|
||||
if (TREE_READONLY (field))
|
||||
@ -4306,10 +4304,7 @@ store_constructor (exp, target, align, cleared, size)
|
||||
}
|
||||
#endif
|
||||
store_constructor_field (to_rtx, bitsize, bitpos, mode,
|
||||
TREE_VALUE (elt), type,
|
||||
MIN (align,
|
||||
DECL_ALIGN (TREE_PURPOSE (elt))),
|
||||
cleared);
|
||||
TREE_VALUE (elt), type, align, cleared);
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (type) == ARRAY_TYPE)
|
||||
|
Loading…
Reference in New Issue
Block a user