PR 37815
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2008 20:48:16 +0000 (20:48 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2008 20:48:16 +0000 (20:48 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141278 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/emit-rtl.c
gcc/emit-rtl.h
gcc/var-tracking.c

index cf00fef..79b2c01 100644 (file)
@@ -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
index 46fefda..ced4e58 100644 (file)
@@ -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:
index 6d4249f..11921a4 100644 (file)
@@ -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
index 2b92e40..1451278 100644 (file)
@@ -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;