From 7fa96708480ddcc02a9e4995bd0dac85678124eb Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 30 Mar 2000 22:17:51 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 3 +++ gcc/expr.c | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eae11d4..a9e54e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Thu Mar 30 06:32:51 2000 Richard Kenner + * 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. 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) -- 2.7.4