summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-25 17:33:43 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-25 17:33:43 +0000
commit0318dc091bfa9ee191ef55b0d5caa1fb8a81fc6b (patch)
tree8933d1c00a302e5243ebedb2a786906439d5decd /gcc/emit-rtl.c
parentd77d42b682e5f48992908de305ca7cf05b3963eb (diff)
downloadgcc-0318dc091bfa9ee191ef55b0d5caa1fb8a81fc6b.tar.gz
* emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos
in ARRAY_REF of DECL_P case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55752 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index ab73f00c6bb..67c4cfbcd03 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)
{