aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-12 10:21:09 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-12 05:21:09 -0500
commit40c0668bf7242d80d940548dc0a987de54da3831 (patch)
tree76fe196dc449b540f0ebdef99b27c045fe8a8b3e /gcc
parent749552c44bc23a0ac79d9083c6e2f872b3d438c1 (diff)
downloadgcc-40c0668bf7242d80d940548dc0a987de54da3831.zip
gcc-40c0668bf7242d80d940548dc0a987de54da3831.tar.gz
gcc-40c0668bf7242d80d940548dc0a987de54da3831.tar.bz2
emit-rtl.c (set_mem_attributes): If making object, can set alignment from type.
* emit-rtl.c (set_mem_attributes): If making object, can set alignment from type. (replace_equiv_address): Call update_temp_slot_address. From-SVN: r46940
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/emit-rtl.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5e83c85..4702f7e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
Mon Nov 12 05:18:42 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * emit-rtl.c (set_mem_attributes): If making object, can set alignment
+ from type.
+ (replace_equiv_address): Call update_temp_slot_address.
+
* dwarf2out.c (loc_descriptor_from_tree, case COMPOUND_EXPR): New case.
* alias.c (nonoverlapping_memrefs_p): Handle DECL_RTL being a CONCAT.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9242e79..73307ec 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1699,6 +1699,11 @@ set_mem_attributes (ref, t, objectp)
if ((objectp || DECL_P (t)) && ! AGGREGATE_TYPE_P (type))
MEM_SCALAR_P (ref) = 1;
+ /* We can set the alignment from the type if we are makign an object or
+ if this is an INDIRECT_REF. */
+ if (objectp || TREE_CODE (t) == INDIRECT_REF)
+ align = TYPE_ALIGN (type);
+
/* If the size is known, we can set that. */
if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1))
size = GEN_INT (tree_low_cst (TYPE_SIZE_UNIT (type), 1));
@@ -1733,11 +1738,7 @@ set_mem_attributes (ref, t, objectp)
align = DECL_ALIGN (t);
}
- /* If this is an INDIRECT_REF, we know its alignment. */
- else if (TREE_CODE (t) == INDIRECT_REF)
- align = TYPE_ALIGN (type);
-
- /* Likewise for constants. */
+ /* If this is a constant, we know the alignment. */
else if (TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
{
align = TYPE_ALIGN (type);
@@ -1961,6 +1962,7 @@ replace_equiv_address (memref, addr)
{
/* change_address_1 copies the memory attribute structure without change
and that's exactly what we want here. */
+ update_temp_slot_address (XEXP (memref, 0), addr);
return change_address_1 (memref, VOIDmode, addr, 1);
}