PATCH: Fix IRIX bootstrap

Mark Mitchell mark@codesourcery.com
Sun Nov 12 22:56:00 GMT 2000


This patch:

  2000-11-11  Jason Merrill  <jason@redhat.com>

	  * function.c (assign_parms): If TREE_ADDRESSABLE is set, try to 
	  give the parm a register and then call put_var_into_stack.
	  * stmt.c (expand_decl): Likewise.

broke the IRIX bootstrap.  Here's the fix.

The problem is that the whole fixup_var_refs machinery is fragile.  It
gets run as RTL is generated, meaning that you have to keep track of
all the places that RTL is lying around, including sequences.  (It's
also very slow; the algorithm is n^2 and is at the top of the profile
for some large sequences.)

The real fix is to do the fixing after all RTL has been generated,
just as we (now) do for ADDRESSOF fixups.  (I put the machinery in to
do the ADDRESSOF stuff efficiently a year or two back, but I've never
gotten around to the RTL generation-time case.)

In any case, this will do for now.

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

2000-11-12  Mark Mitchell  <mark@codesourcery.com>

	* function.c (assign_parms): When calling put_var_into_stack, make
	sure that there are no hidden pending sequences.

Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.230
diff -c -p -r1.230 function.c
*** function.c	2000/11/12 00:11:45	1.230
--- function.c	2000/11/13 04:03:05
*************** assign_parms (fndecl)
*** 4863,4869 ****
  
  	  /* If something wants our address, try to use ADDRESSOF.  */
  	  if (TREE_ADDRESSABLE (parm))
! 	    put_var_into_stack (parm);
  	}
        else
  	{
--- 4863,4881 ----
  
  	  /* If something wants our address, try to use ADDRESSOF.  */
  	  if (TREE_ADDRESSABLE (parm))
! 	    {
! 	      /* If we end up putting something into the stack,
! 		 fixup_var_refs_insns will need to make a pass over
! 		 all the instructions.  It looks throughs the pending
! 		 sequences -- but it can't see the ones in the
! 		 CONVERSION_INSNS, if they're not on the sequence
! 		 stack.  So, we go back to that sequence, just so that
! 		 the fixups will happen.  */
! 	      push_to_sequence (conversion_insns);
! 	      put_var_into_stack (parm);
! 	      conversion_insns = get_insns ();
! 	      end_sequence ();
! 	    }
  	}
        else
  	{


More information about the Gcc-patches mailing list