]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport a fix to the 2.95 branch
authorBernd Schmidt <bernds@redhat.co.uk>
Fri, 22 Dec 2000 14:19:57 +0000 (14:19 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 22 Dec 2000 14:19:57 +0000 (14:19 +0000)
From-SVN: r38456

gcc/ChangeLog
gcc/function.c

index 46935a9b7c41d3e8fa823cd3c2a21fbadd8caae2..0e202f393415485b29b1810229e432b105a4980a 100644 (file)
@@ -1,5 +1,9 @@
 2000-12-22  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       2000-03-06  Mark Mitchell  <mark@codesourcery.com>
+       * function.c (free_temps_for_rtl_expr): Don't free slots
+       that have been pushed into a higher level.
+
        1999-12-16  David S. Miller  <davem@redhat.com>
        * expr.c (emit_move_insn_1): Only emit clobbers if one of
        the outputs is a SUBREG.
index 60afafa9c198706f57064bfbaa28c9f78255ff87..a4033a9a6b836e9231fb7122666a17ba8ab8b547 100644 (file)
@@ -1428,7 +1428,16 @@ free_temps_for_rtl_expr (t)
 
   for (p = temp_slots; p; p = p->next)
     if (p->rtl_expr == t)
-      p->in_use = 0;
+      {
+       /* If this slot is below the current TEMP_SLOT_LEVEL, then it
+          needs to be preserved.  This can happen if a temporary in
+          the RTL_EXPR was addressed; preserve_temp_slots will move
+          the temporary into a higher level.   */
+       if (temp_slot_level <= p->level)
+         p->in_use = 0;
+       else
+         p->rtl_expr = NULL_TREE;
+      }
 
   combine_temp_slots ();
 }