diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-10 10:21:31 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-10 10:21:31 +0000 |
commit | 18a8d8ef31080fb83c7706fcc32e01c5054e019d (patch) | |
tree | b081f5bedd4bbb3b5b431946e31f82948a6efb09 /gcc/emit-rtl.c | |
parent | 7e59625d1a6f3ec0132cbb4e83530fd9df32b887 (diff) | |
download | gcc-18a8d8ef31080fb83c7706fcc32e01c5054e019d.tar.gz |
2008-10-10 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r141021
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 318ae775330..4564a0b7485 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1564,6 +1564,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, if (! TYPE_P (t)) { tree base; + bool align_computed = false; if (TREE_THIS_VOLATILE (t)) MEM_VOLATILE_P (ref) = 1; @@ -1620,6 +1621,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, && host_integerp (DECL_SIZE_UNIT (t), 1) ? GEN_INT (tree_low_cst (DECL_SIZE_UNIT (t), 1)) : 0); align = DECL_ALIGN (t); + align_computed = true; } /* If this is a constant, we know the alignment. */ @@ -1629,6 +1631,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, #ifdef CONSTANT_ALIGNMENT align = CONSTANT_ALIGNMENT (t, align); #endif + align_computed = true; } /* If this is a field reference and not a bit-field, record it. */ @@ -1688,6 +1691,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, align = DECL_ALIGN (t2); if (aoff && (unsigned HOST_WIDE_INT) aoff < align) align = aoff; + align_computed = true; offset = GEN_INT (ioff); apply_bitpos = bitpos; } @@ -1721,6 +1725,13 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, expr = t; offset = NULL; } + + if (!align_computed && !INDIRECT_REF_P (t)) + { + unsigned int obj_align + = get_object_alignment (t, align, BIGGEST_ALIGNMENT); + align = MAX (align, obj_align); + } } /* If we modified OFFSET based on T, then subtract the outstanding |