diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-22 00:23:47 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-22 00:23:47 +0000 |
commit | 2d8fe5d004f9b3fb52ea63fc74aca6d70f1f5fa9 (patch) | |
tree | 270dccb5bfc81ab3da7eb1b086e39f7ee7bdafe0 /gcc/emit-rtl.c | |
parent | f4dbfb4e9e3e291fd9218c829ff31b87b4af70af (diff) | |
download | gcc-2d8fe5d004f9b3fb52ea63fc74aca6d70f1f5fa9.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55633 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index af537d257f0..ab73f00c6bb 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; } } |