diff options
author | Richard Henderson <rth@redhat.com> | 2002-07-21 17:23:47 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-07-21 17:23:47 -0700 |
commit | c67a1cf6a842249a064d479b455321e6663e4708 (patch) | |
tree | 270dccb5bfc81ab3da7eb1b086e39f7ee7bdafe0 | |
parent | b68daef415643d8b384f939917b8802e300f1893 (diff) | |
download | gcc-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
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/alias.c | 15 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 29 | ||||
-rw-r--r-- | gcc/print-rtl.c | 6 |
4 files changed, 56 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9d4cbb..a852ef7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-07-21 Richard Henderson <rth@redhat.com> + + * 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. + 2002-07-21 Hartmut Schirmer <hartmut.schirmer@arcor.de> * libgcc2.c (__divdi3, __moddi3): Use unary minus operator diff --git a/gcc/alias.c b/gcc/alias.c index 2e6a2b0..68a8272 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1957,6 +1957,14 @@ nonoverlapping_memrefs_p (x, y) moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); exprx = t; } + else if (TREE_CODE (exprx) == INDIRECT_REF) + { + exprx = TREE_OPERAND (exprx, 0); + if (flag_argument_noalias < 2 + || TREE_CODE (exprx) != PARM_DECL) + return 0; + } + moffsety = MEM_OFFSET (y); if (TREE_CODE (expry) == COMPONENT_REF) { @@ -1966,6 +1974,13 @@ nonoverlapping_memrefs_p (x, y) moffsety = adjust_offset_for_component_ref (expry, moffsety); expry = t; } + else if (TREE_CODE (expry) == INDIRECT_REF) + { + expry = TREE_OPERAND (expry, 0); + if (flag_argument_noalias < 2 + || TREE_CODE (expry) != PARM_DECL) + return 0; + } if (! DECL_P (exprx) || ! DECL_P (expry)) return 0; 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; } } diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 1553805..25704eb 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -92,6 +92,12 @@ print_mem_expr (outfile, expr) fprintf (outfile, ".%s", IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (expr, 1)))); } + else if (TREE_CODE (expr) == INDIRECT_REF) + { + fputs (" (*", outfile); + print_mem_expr (outfile, TREE_OPERAND (expr, 0)); + fputs (")", outfile); + } else if (DECL_NAME (expr)) fprintf (outfile, " %s", IDENTIFIER_POINTER (DECL_NAME (expr))); else if (TREE_CODE (expr) == RESULT_DECL) |