From: Richard Henderson Date: Thu, 25 Jul 2002 17:33:43 +0000 (-0700) Subject: emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos in ARRAY_REF of DECL_... X-Git-Tag: releases/gcc-3.3.0~3636 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40cb04f19b3d49770cd90927700c493adaff58b8;p=thirdparty%2Fgcc.git emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos in ARRAY_REF of DECL_P case. * emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos in ARRAY_REF of DECL_P case. From-SVN: r55752 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad40abd9b0bd..ef6b358992ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-07-25 Richard Henderson + + * emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos + in ARRAY_REF of DECL_P case. + 2002-07-25 Richard Sandiford * doc/invoke.texi: Document -mabi=meabi, and expand on the EABI diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index ab73f00c6bbd..67c4cfbcd039 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1808,12 +1808,16 @@ set_mem_attributes (ref, t, objectp) if (DECL_P (t)) { expr = t; + offset = NULL; if (host_integerp (off_tree, 1)) - offset = GEN_INT (tree_low_cst (off_tree, 1)); - size = (DECL_SIZE_UNIT (t) - && host_integerp (DECL_SIZE_UNIT (t), 1) - ? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0); - align = DECL_ALIGN (t); + { + HOST_WIDE_INT ioff = tree_low_cst (off_tree, 1); + HOST_WIDE_INT aoff = (ioff & -ioff) * BITS_PER_UNIT; + align = DECL_ALIGN (t); + if (aoff && aoff < align) + align = aoff; + offset = GEN_INT (ioff); + } } else if (TREE_CODE (t) == COMPONENT_REF) {