aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-03-30 22:17:51 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-03-30 17:17:51 -0500
commit7fa96708480ddcc02a9e4995bd0dac85678124eb (patch)
tree518fb401e070b0e836893395de180122a5622ad4 /gcc/expr.c
parent0e805f815e91234061a8e8380f60f479dcbb9cdf (diff)
downloadgcc-7fa96708480ddcc02a9e4995bd0dac85678124eb.zip
gcc-7fa96708480ddcc02a9e4995bd0dac85678124eb.tar.gz
gcc-7fa96708480ddcc02a9e4995bd0dac85678124eb.tar.bz2
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
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 6cb66f6..c1866a5 100644
--- a/gcc/expr.c
+++ b/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)