summaryrefslogtreecommitdiff
path: root/gcc/print-rtl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-12-02 11:04:23 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-12-02 11:04:23 -0800
commit998d7deb143c6511c68e21abb811af9f5524f89d (patch)
tree7dcf60eaed1d63b62946ca9c11cf34b2d9ceaa21 /gcc/print-rtl.c
parent3d55d212918e4f8853365fbf7531d30b9d88a82f (diff)
downloadgcc-998d7deb143c6511c68e21abb811af9f5524f89d.tar.gz
rtl.h (mem_attrs): Rename decl to expr; adjust all users.
* rtl.h (mem_attrs): Rename decl to expr; adjust all users. (MEM_EXPR): Rename from MEM_DECL; adjust all users. * emit-rtl.c (set_mem_expr): Rename from set_mem_decl. * expr.h, final.c, reload1.c: Adjust users. * alias.c (nonoverlapping_component_refs_p): New. (decl_for_component_ref, adjust_offset_for_component_ref): New. (nonoverlapping_memrefs_p): Use them. * emit-rtl.c (component_ref_for_mem_expr): New. (set_mem_attributes): Use it. (set_mem_offset): New. * expr.c (expand_assignment): Call set_mem_attributes for inner references; adjust the memory offset as needed. * print-rtl.c (print_mem_expr): New. (print_rtx): Use it. From-SVN: r47534
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r--gcc/print-rtl.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 3213a511926..b819d143a34 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -77,6 +77,28 @@ int dump_for_graph;
/* Nonzero to dump all call_placeholder alternatives. */
static int debug_call_placeholder_verbose;
+void
+print_mem_expr (outfile, expr)
+ FILE *outfile;
+ tree expr;
+{
+ if (TREE_CODE (expr) == COMPONENT_REF)
+ {
+ if (TREE_OPERAND (expr, 0))
+ print_mem_expr (outfile, TREE_OPERAND (expr, 0));
+ else
+ fputs (" <variable>", outfile);
+ fprintf (outfile, ".%s",
+ IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (expr, 1))));
+ }
+ else if (DECL_NAME (expr))
+ fprintf (outfile, " %s", IDENTIFIER_POINTER (DECL_NAME (expr)));
+ else if (TREE_CODE (expr) == RESULT_DECL)
+ fputs (" <result>", outfile);
+ else
+ fputs (" <anonymous>", outfile);
+}
+
/* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
static void
@@ -456,12 +478,9 @@ print_rtx (in_rtx)
case MEM:
fputs (" [", outfile);
fprintf (outfile, HOST_WIDE_INT_PRINT_DEC, MEM_ALIAS_SET (in_rtx));
- if (MEM_DECL (in_rtx))
- fprintf (outfile, " %s",
- DECL_NAME (MEM_DECL (in_rtx))
- ? IDENTIFIER_POINTER (DECL_NAME (MEM_DECL (in_rtx)))
- : TREE_CODE (MEM_DECL (in_rtx)) == RESULT_DECL ? "<result>"
- : "<anonymous>");
+
+ if (MEM_EXPR (in_rtx))
+ print_mem_expr (outfile, MEM_EXPR (in_rtx));
if (MEM_OFFSET (in_rtx))
{