aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-07-21 17:23:47 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-07-21 17:23:47 -0700
commitc67a1cf6a842249a064d479b455321e6663e4708 (patch)
tree270dccb5bfc81ab3da7eb1b086e39f7ee7bdafe0 /gcc/emit-rtl.c
parentb68daef415643d8b384f939917b8802e300f1893 (diff)
downloadgcc-c67a1cf6a842249a064d479b455321e6663e4708.zip
gcc-c67a1cf6a842249a064d479b455321e6663e4708.tar.gz
gcc-c67a1cf6a842249a064d479b455321e6663e4708.tar.bz2
emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL when flag_argument_noalias == 2.
* emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL when flag_argument_noalias == 2. * alias.c (nonoverlapping_memrefs_p): Handle that. * print-rtl.c (print_mem_expr): Likewise. From-SVN: r55633
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index af537d2..ab73f00 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1805,7 +1805,17 @@ set_mem_attributes (ref, t, objectp)
}
while (TREE_CODE (t) == ARRAY_REF);
- if (TREE_CODE (t) == COMPONENT_REF)
+ if (DECL_P (t))
+ {
+ expr = t;
+ 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);
+ }
+ else if (TREE_CODE (t) == COMPONENT_REF)
{
expr = component_ref_for_mem_expr (t);
if (host_integerp (off_tree, 1))
@@ -1813,6 +1823,23 @@ set_mem_attributes (ref, t, objectp)
/* ??? Any reason the field size would be different than
the size we got from the type? */
}
+ else if (flag_argument_noalias > 1
+ && TREE_CODE (t) == INDIRECT_REF
+ && TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL)
+ {
+ expr = t;
+ offset = NULL;
+ }
+ }
+
+ /* If this is a Fortran indirect argument reference, record the
+ parameter decl. */
+ else if (flag_argument_noalias > 1
+ && TREE_CODE (t) == INDIRECT_REF
+ && TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL)
+ {
+ expr = t;
+ offset = NULL;
}
}