aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2008-10-21 13:48:16 -0700
committerRichard Henderson <rth@gcc.gnu.org>2008-10-21 13:48:16 -0700
commit3d7e23f61d6aab5fce928df758ad6117ba38ab45 (patch)
tree052bfb82b1dc059871fa44b6f66ba8b9ead7deca /gcc
parent86b9515c41b13f0fca9d0e89dd495772a014d364 (diff)
downloadgcc-3d7e23f61d6aab5fce928df758ad6117ba38ab45.zip
gcc-3d7e23f61d6aab5fce928df758ad6117ba38ab45.tar.gz
gcc-3d7e23f61d6aab5fce928df758ad6117ba38ab45.tar.bz2
re PR middle-end/37815 (ICE in vt_add_function_parameters (bootstrap error))
PR 37815 * emit-rtl.c (get_spill_slot_decl): Export. * emit-rtl.h (get_spill_slot_decl): Declare. * var-tracking.c (vt_add_function_parameters): Relax assertion on the contents of MEM_EXPR in a PARM_DECL to include a spill slot. From-SVN: r141278
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/emit-rtl.c8
-rw-r--r--gcc/emit-rtl.h1
-rw-r--r--gcc/var-tracking.c11
4 files changed, 23 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cf00fef..79b2c01 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-21 Richard Henderson <rth@redhat.com>
+
+ PR 37815
+ * emit-rtl.c (get_spill_slot_decl): Export.
+ * emit-rtl.h (get_spill_slot_decl): Declare.
+ * var-tracking.c (vt_add_function_parameters): Relax assertion
+ on the contents of MEM_EXPR in a PARM_DECL to include a spill slot.
+
2008-10-21 Bob Wilson <bob.wilson@acm.org>
* var-tracking.c (insn_stack_adjust_offset_pre_post): If insn has a
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 46fefda..ced4e58 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2141,13 +2141,13 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
/* A fake decl that is used as the MEM_EXPR of spill slots. */
static GTY(()) tree spill_slot_decl;
-static tree
-get_spill_slot_decl (void)
+tree
+get_spill_slot_decl (bool force_build_p)
{
tree d = spill_slot_decl;
rtx rd;
- if (d)
+ if (d || !force_build_p)
return d;
d = build_decl (VAR_DECL, get_identifier ("%sfp"), void_type_node);
@@ -2179,7 +2179,7 @@ set_mem_attrs_for_spill (rtx mem)
rtx addr, offset;
tree expr;
- expr = get_spill_slot_decl ();
+ expr = get_spill_slot_decl (true);
alias = MEM_ALIAS_SET (DECL_RTL (expr));
/* We expect the incoming memory to be of the form:
diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h
index 6d4249f..11921a4 100644
--- a/gcc/emit-rtl.h
+++ b/gcc/emit-rtl.h
@@ -37,6 +37,7 @@ extern void set_mem_size (rtx, rtx);
/* Set the attributes for MEM appropriate for a spill slot. */
extern void set_mem_attrs_for_spill (rtx);
+extern tree get_spill_slot_decl (bool);
/* Return a memory reference like MEMREF, but with its address changed to
ADDR. The caller is asserting that the actual piece of memory pointed
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 2b92e40..1451278 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -3182,7 +3182,16 @@ vt_add_function_parameters (void)
if (!decl)
continue;
- gcc_assert (parm == decl);
+ if (parm != decl)
+ {
+ /* Assume that DECL_RTL was a pseudo that got spilled to
+ memory. The spill slot sharing code will force the
+ memory to reference spill_slot_decl (%sfp), so we don't
+ match above. That's ok, the pseudo must have referenced
+ the entire parameter, so just reset OFFSET. */
+ gcc_assert (decl == get_spill_slot_decl (false));
+ offset = 0;
+ }
if (!track_loc_p (incoming, parm, offset, false, &mode, &offset))
continue;