PATCH: RTL_EXPR vs. inlining, again

Mark Mitchell mark@codesourcery.com
Mon Mar 6 01:54:00 GMT 2000


Thanks to Kenner's latest hint, I think I understand a) what his point
was, and b) where the bug was.  BTW, Kenner, I think that if Ada did
anything similar to what C++ was doing, it was probably pretty broken.

The slot in question was getting marked as addressed -- but that
didn't persuade free_temps_for_rtl_expr not to free it.  Kenner, if
you don't think this is quite right, please feel free to tweak
accordingly -- I think given this patch you'll see the bug.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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.

	Revert this patch:
	2000-03-05  Mark Mitchell  <mark@codesourcery.com>

Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.171
diff -c -p -r1.171 function.c
*** function.c	2000/03/05 20:43:43	1.171
--- function.c	2000/03/06 09:45:24
*************** free_temps_for_rtl_expr (t)
*** 1215,1221 ****
  
    for (p = temp_slots; p; p = p->next)
      if (p->rtl_expr == t)
!       p->in_use = 0;
  
    combine_temp_slots ();
  }
--- 1187,1202 ----
  
    for (p = temp_slots; p; p = p->next)
      if (p->rtl_expr == t)
!       {
! 	/* 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 ();
  }


More information about the Gcc-patches mailing list