This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sibbling calls versus integreate.c


Hi,
this huge, but mechanical pass handles first part of problem with sibbling calls
and optimizations.

As I've sent previously to gcc-bugs, we do use VIRTUAL_INCOMMING_ARGS to store
arguments in sibcall sequence.  When integreate.c sees the code, it thinks,
that the integreated function plays bad games with it's incomming arguments
and allocates area on stack where it stores them.

This is wrong, as we still want to access the incomming arugments of the
function (not inlined one) to make sibcall sequence and works only because
we never actually output the sibcall.

This patch only avoids this bad converison. To get sibcalls out of inlined
calls, we need to update considerably the sibcall.c, but I am not going to
do that.

I want to avoid bad effects of allocating the extra space on stack - this includes
for instance disabling of any other sibcalls in the function because of test:

	  /* See if there are any reasons we can't perform either sibling or
	     tail call optimizations.  We must be careful with stack slots
	     which are live at potential optimization sites.  ??? The first
	     test is overly conservative and should be replaced.  */
	  if (frame_offset
	      /* Can't take address of local var if used by recursive call.  */
	      || current_function_uses_addressof

Bootstrapped/regtested athlon.

Honza

Wed Aug  8 18:16:05 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* integreate.c (copy_insn_list): Add "in_sibcall" parameter;
	update all callers; pass in_sibcall as true inside CALL_PLACEHOLTER.
	(copy_insn_notes): Likewise; pass in_sibcall as true
	inside sibcall sequence; update all callers.
	(copy_rtx_and_substitute): Add "in_sibcall" parameter; update
	all callers; bypass handling of VIRTUAL_INCOMMING_ARGS
	inside sibcalls.
	* integrate.h (copy_rtx_and_subsitute): Update prototype.
	* unroll.c (copy_loop_body): update copy_rtx_and_substitute call.

*** integrate.c.sib	Tue Aug  7 15:57:27 2001
--- integrate.c	Tue Aug  7 16:23:19 2001
*************** void set_decl_abstract_flags		PARAMS ((t
*** 100,108 ****
  static void mark_stores                 PARAMS ((rtx, rtx, void *));
  static void save_parm_insns		PARAMS ((rtx, rtx));
  static void copy_insn_list              PARAMS ((rtx, struct inline_remap *,
! 						 rtx));
  static void copy_insn_notes		PARAMS ((rtx, struct inline_remap *,
! 						 int));
  static int compare_blocks               PARAMS ((const PTR, const PTR));
  static int find_block                   PARAMS ((const PTR, const PTR));
  
--- 100,108 ----
  static void mark_stores                 PARAMS ((rtx, rtx, void *));
  static void save_parm_insns		PARAMS ((rtx, rtx));
  static void copy_insn_list              PARAMS ((rtx, struct inline_remap *,
! 						 rtx, int));
  static void copy_insn_notes		PARAMS ((rtx, struct inline_remap *,
! 						 int, int));
  static int compare_blocks               PARAMS ((const PTR, const PTR));
  static int find_block                   PARAMS ((const PTR, const PTR));
  
*************** expand_inline_function (fndecl, parms, t
*** 908,914 ****
  	     sure we have enough slots in the const equiv map since the
  	     store_expr call can easily blow the size estimate.  */
  	  if (DECL_SAVED_INSNS (fndecl)->args_size != 0)
! 	    copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0);
  	}
        else if (GET_CODE (loc) == REG)
  	process_reg_param (map, loc, copy);
--- 908,914 ----
  	     sure we have enough slots in the const equiv map since the
  	     store_expr call can easily blow the size estimate.  */
  	  if (DECL_SAVED_INSNS (fndecl)->args_size != 0)
! 	    copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0, false);
  	}
        else if (GET_CODE (loc) == REG)
  	process_reg_param (map, loc, copy);
*************** expand_inline_function (fndecl, parms, t
*** 951,957 ****
  
  	  /* Compute the address in the area we reserved and store the
  	     value there.  */
! 	  temp = copy_rtx_and_substitute (loc, map, 1);
  	  subst_constants (&temp, NULL_RTX, map, 1);
  	  apply_change_group ();
  	  if (! memory_address_p (GET_MODE (temp), XEXP (temp, 0)))
--- 951,957 ----
  
  	  /* Compute the address in the area we reserved and store the
  	     value there.  */
! 	  temp = copy_rtx_and_substitute (loc, map, 1, false);
  	  subst_constants (&temp, NULL_RTX, map, 1);
  	  apply_change_group ();
  	  if (! memory_address_p (GET_MODE (temp), XEXP (temp, 0)))
*************** expand_inline_function (fndecl, parms, t
*** 977,983 ****
      {
        if (GET_CODE (XEXP (loc, 0)) == ADDRESSOF)
  	{
! 	  temp = copy_rtx_and_substitute (loc, map, 1);
  	  subst_constants (&temp, NULL_RTX, map, 1);
  	  apply_change_group ();
  	  target = temp;
--- 977,983 ----
      {
        if (GET_CODE (XEXP (loc, 0)) == ADDRESSOF)
  	{
! 	  temp = copy_rtx_and_substitute (loc, map, 1, false);
  	  subst_constants (&temp, NULL_RTX, map, 1);
  	  apply_change_group ();
  	  target = temp;
*************** expand_inline_function (fndecl, parms, t
*** 1027,1033 ****
  	    }
  	  else
  	    {
! 	      temp = copy_rtx_and_substitute (loc, map, 1);
  	      subst_constants (&temp, NULL_RTX, map, 0);
  	      apply_change_group ();
  	      emit_move_insn (temp, structure_value_addr);
--- 1027,1033 ----
  	    }
  	  else
  	    {
! 	      temp = copy_rtx_and_substitute (loc, map, 1, false);
  	      subst_constants (&temp, NULL_RTX, map, 0);
  	      apply_change_group ();
  	      emit_move_insn (temp, structure_value_addr);
*************** expand_inline_function (fndecl, parms, t
*** 1186,1192 ****
    setup_initial_hard_reg_value_integration (inl_f, map);
  
    /* Now copy the insns one by one.  */
!   copy_insn_list (insns, map, static_chain_value);
  
    /* Duplicate the EH regions.  This will create an offset from the
       region numbers in the function we're inlining to the region
--- 1186,1192 ----
    setup_initial_hard_reg_value_integration (inl_f, map);
  
    /* Now copy the insns one by one.  */
!   copy_insn_list (insns, map, static_chain_value, false);
  
    /* Duplicate the EH regions.  This will create an offset from the
       region numbers in the function we're inlining to the region
*************** expand_inline_function (fndecl, parms, t
*** 1195,1201 ****
    eh_region_offset = duplicate_eh_regions (inl_f, map);
  
    /* Now copy the REG_NOTES for those insns.  */
!   copy_insn_notes (insns, map, eh_region_offset);
  
    /* If the insn sequence required one, emit the return label.  */
    if (map->local_return_label)
--- 1195,1201 ----
    eh_region_offset = duplicate_eh_regions (inl_f, map);
  
    /* Now copy the REG_NOTES for those insns.  */
!   copy_insn_notes (insns, map, eh_region_offset, false);
  
    /* If the insn sequence required one, emit the return label.  */
    if (map->local_return_label)
*************** expand_inline_function (fndecl, parms, t
*** 1271,1286 ****
     computed in expand_inline_function. This function may call itself for
     insns containing sequences.
  
     Copying is done in two passes, first the insns and then their REG_NOTES.
  
     If static_chain_value is non-zero, it represents the context-pointer
     register for the function.  */
  
  static void
! copy_insn_list (insns, map, static_chain_value)
       rtx insns;
       struct inline_remap *map;
       rtx static_chain_value;
  {
    register int i;
    rtx insn;
--- 1271,1290 ----
     computed in expand_inline_function. This function may call itself for
     insns containing sequences.
  
+    When IN_SIBCALL is nonzero, thread virtual registers especially to properly
+    translate sibcall sequence.
+ 
     Copying is done in two passes, first the insns and then their REG_NOTES.
  
     If static_chain_value is non-zero, it represents the context-pointer
     register for the function.  */
  
  static void
! copy_insn_list (insns, map, static_chain_value, in_sibcall)
       rtx insns;
       struct inline_remap *map;
       rtx static_chain_value;
+      int in_sibcall;
  {
    register int i;
    rtx insn;
*************** copy_insn_list (insns, map, static_chain
*** 1326,1332 ****
  
  		  /* If we must not delete the source,
  		     load it into a new temporary.  */
! 		  copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
  
  		  new_set = single_set (copy);
  		  if (new_set == 0)
--- 1330,1337 ----
  
  		  /* If we must not delete the source,
  		     load it into a new temporary.  */
! 		  copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0,
! 							     in_sibcall));
  
  		  new_set = single_set (copy);
  		  if (new_set == 0)
*************** copy_insn_list (insns, map, static_chain
*** 1339,1345 ****
  		 has a note on it, keep the insn.  */
  	      else if (rtx_equal_p (SET_DEST (set), SET_SRC (set))
  		       && REG_NOTES (insn) != 0)
! 		copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
  	      else
  		break;
  	    }
--- 1344,1351 ----
  		 has a note on it, keep the insn.  */
  	      else if (rtx_equal_p (SET_DEST (set), SET_SRC (set))
  		       && REG_NOTES (insn) != 0)
! 		copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0,
! 							   in_sibcall));
  	      else
  		break;
  	    }
*************** copy_insn_list (insns, map, static_chain
*** 1366,1372 ****
  		   && rtx_equal_p (SET_SRC (set),
  				   static_chain_incoming_rtx))
  	    {
! 	      rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map, 1);
  
  	      copy = emit_move_insn (newdest, static_chain_value);
  	      static_chain_value = 0;
--- 1372,1379 ----
  		   && rtx_equal_p (SET_SRC (set),
  				   static_chain_incoming_rtx))
  	    {
! 	      rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map, 1,
! 						     in_sibcall);
  
  	      copy = emit_move_insn (newdest, static_chain_value);
  	      static_chain_value = 0;
*************** copy_insn_list (insns, map, static_chain
*** 1407,1413 ****
  	    }
  
  	  else
! 	    copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
  	  /* REG_NOTES will be copied later.  */
  
  #ifdef HAVE_cc0
--- 1414,1421 ----
  	    }
  
  	  else
! 	    copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0,
! 						       in_sibcall));
  	  /* REG_NOTES will be copied later.  */
  
  #ifdef HAVE_cc0
*************** copy_insn_list (insns, map, static_chain
*** 1446,1452 ****
  	      pattern = gen_jump (map->local_return_label);
  	    }
  	  else
! 	    pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
  
  	  copy = emit_jump_insn (pattern);
  
--- 1454,1461 ----
  	      pattern = gen_jump (map->local_return_label);
  	    }
  	  else
! 	    pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0,
! 					       in_sibcall);
  
  	  copy = emit_jump_insn (pattern);
  
*************** copy_insn_list (insns, map, static_chain
*** 1499,1505 ****
  		  if (seq)
  		    {
  		      start_sequence ();
! 		      copy_insn_list (seq, map, static_chain_value);
  		      sequence[i] = get_insns ();
  		      end_sequence ();
  		    }
--- 1508,1514 ----
  		  if (seq)
  		    {
  		      start_sequence ();
! 		      copy_insn_list (seq, map, static_chain_value, true);
  		      sequence[i] = get_insns ();
  		      end_sequence ();
  		    }
*************** copy_insn_list (insns, map, static_chain
*** 1508,1514 ****
  	      /* Find the new tail recursion label.
  	         It will already be substituted into sequence[2].  */
  	      tail_label = copy_rtx_and_substitute (XEXP (PATTERN (insn), 3),
! 						    map, 0);
  
  	      copy = emit_call_insn (gen_rtx_CALL_PLACEHOLDER (VOIDmode,
  							       sequence[0],
--- 1517,1523 ----
  	      /* Find the new tail recursion label.
  	         It will already be substituted into sequence[2].  */
  	      tail_label = copy_rtx_and_substitute (XEXP (PATTERN (insn), 3),
! 						    map, 0, in_sibcall);
  
  	      copy = emit_call_insn (gen_rtx_CALL_PLACEHOLDER (VOIDmode,
  							       sequence[0],
*************** copy_insn_list (insns, map, static_chain
*** 1518,1524 ****
  	      break;
  	    }
  
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
  	  copy = emit_call_insn (pattern);
  
  	  SIBLING_CALL_P (copy) = SIBLING_CALL_P (insn);
--- 1527,1533 ----
  	      break;
  	    }
  
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0, in_sibcall);
  	  copy = emit_call_insn (pattern);
  
  	  SIBLING_CALL_P (copy) = SIBLING_CALL_P (insn);
*************** copy_insn_list (insns, map, static_chain
*** 1529,1535 ****
  
  	  CALL_INSN_FUNCTION_USAGE (copy)
  	    = copy_rtx_and_substitute (CALL_INSN_FUNCTION_USAGE (insn),
! 				       map, 0);
  
  #ifdef HAVE_cc0
  	  if (cc0_insn)
--- 1538,1544 ----
  
  	  CALL_INSN_FUNCTION_USAGE (copy)
  	    = copy_rtx_and_substitute (CALL_INSN_FUNCTION_USAGE (insn),
! 				       map, 0, in_sibcall);
  
  #ifdef HAVE_cc0
  	  if (cc0_insn)
*************** copy_insn_list (insns, map, static_chain
*** 1598,1604 ****
  		       && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
  		NOTE_EXPECTED_VALUE (copy)
  		  = copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
! 					     map, 0);
  	    }
  	  else
  	    copy = 0;
--- 1607,1613 ----
  		       && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
  		NOTE_EXPECTED_VALUE (copy)
  		  = copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
! 					     map, 0, in_sibcall);
  	    }
  	  else
  	    copy = 0;
*************** copy_insn_list (insns, map, static_chain
*** 1620,1629 ****
     that are valid across the entire function.  */
  
  static void
! copy_insn_notes (insns, map, eh_region_offset)
       rtx insns;
       struct inline_remap *map;
       int eh_region_offset;
  {
    rtx insn, new_insn;
  
--- 1629,1639 ----
     that are valid across the entire function.  */
  
  static void
! copy_insn_notes (insns, map, eh_region_offset, in_sibcall)
       rtx insns;
       struct inline_remap *map;
       int eh_region_offset;
+      int in_sibcall;
  {
    rtx insn, new_insn;
  
*************** copy_insn_notes (insns, map, eh_region_o
*** 1639,1645 ****
  
        if (REG_NOTES (insn))
          {
! 	  rtx next, note = copy_rtx_and_substitute (REG_NOTES (insn), map, 0);
  
  	  /* We must also do subst_constants, in case one of our parameters
  	     has const type and constant value.  */
--- 1649,1656 ----
  
        if (REG_NOTES (insn))
          {
! 	  rtx next, note = copy_rtx_and_substitute (REG_NOTES (insn), map, 0,
! 						    in_sibcall);
  
  	  /* We must also do subst_constants, in case one of our parameters
  	     has const type and constant value.  */
*************** copy_insn_notes (insns, map, eh_region_o
*** 1665,1671 ****
  	{
  	  int i;
  	  for (i = 0; i < 3; i++)
! 	    copy_insn_notes (XEXP (PATTERN (insn), i), map, eh_region_offset);
  	}
  
        if (GET_CODE (insn) == JUMP_INSN
--- 1676,1683 ----
  	{
  	  int i;
  	  for (i = 0; i < 3; i++)
! 	    copy_insn_notes (XEXP (PATTERN (insn), i), map, eh_region_offset,
! 			     true);
  	}
  
        if (GET_CODE (insn) == JUMP_INSN
*************** integrate_parm_decls (args, map, arg_vec
*** 1691,1697 ****
        tree decl = copy_decl_for_inlining (tail, map->fndecl,
  					  current_function_decl);
        rtx new_decl_rtl
! 	= copy_rtx_and_substitute (RTVEC_ELT (arg_vector, i), map, 1);
  
        /* We really should be setting DECL_INCOMING_RTL to something reasonable
  	 here, but that's going to require some more work.  */
--- 1703,1709 ----
        tree decl = copy_decl_for_inlining (tail, map->fndecl,
  					  current_function_decl);
        rtx new_decl_rtl
! 	= copy_rtx_and_substitute (RTVEC_ELT (arg_vector, i), map, 1, false);
  
        /* We really should be setting DECL_INCOMING_RTL to something reasonable
  	 here, but that's going to require some more work.  */
*************** integrate_decl_tree (let, map)
*** 1736,1742 ****
  	{
  	  rtx r;
  
! 	  SET_DECL_RTL (d, copy_rtx_and_substitute (DECL_RTL (t), map, 1));
  
  	  /* Fully instantiate the address with the equivalent form so that the
  	     debugging information contains the actual register, instead of the
--- 1748,1754 ----
  	{
  	  rtx r;
  
! 	  SET_DECL_RTL (d, copy_rtx_and_substitute (DECL_RTL (t), map, 1, false));
  
  	  /* Fully instantiate the address with the equivalent form so that the
  	     debugging information contains the actual register, instead of the
*************** integrate_decl_tree (let, map)
*** 1779,1793 ****
     be the LHS of a SET.  In that case, we copy RTX_UNCHANGING_P even if
     inlining since we need to be conservative in how it is set for
     such cases.
  
     Handle constants that need to be placed in the constant pool by
     calling `force_const_mem'.  */
  
  rtx
! copy_rtx_and_substitute (orig, map, for_lhs)
       register rtx orig;
       struct inline_remap *map;
       int for_lhs;
  {
    register rtx copy, temp;
    register int i, j;
--- 1791,1809 ----
     be the LHS of a SET.  In that case, we copy RTX_UNCHANGING_P even if
     inlining since we need to be conservative in how it is set for
     such cases.
+  
+    if IN_SIBCALL is nonzero, assume we are substituting insn inside sibbling
+    call sequence.
  
     Handle constants that need to be placed in the constant pool by
     calling `force_const_mem'.  */
  
  rtx
! copy_rtx_and_substitute (orig, map, for_lhs, in_sibcall)
       register rtx orig;
       struct inline_remap *map;
       int for_lhs;
+      int in_sibcall;
  {
    register rtx copy, temp;
    register int i, j;
*************** copy_rtx_and_substitute (orig, map, for_
*** 1866,1875 ****
  	      emit_insn_after (seq, map->insns_at_start);
  	      return temp;
  	    }
! 	  else if (regno == VIRTUAL_INCOMING_ARGS_REGNUM
! 		   || (map->integrating
! 		       && (DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer
! 			   == orig)))
  	    {
  	      /* Do the same for a block to contain any arguments referenced
  		 in memory.  */
--- 1882,1895 ----
  	      emit_insn_after (seq, map->insns_at_start);
  	      return temp;
  	    }
! 	  /* In case we are inside sibcall sequence,
! 	     VIRTUAL_INCOMMING_ARGS_REGNUM reffers to the real one, so we don't
! 	     need to make copy.  */
! 	  else if (!in_sibcall
! 		   && (regno == VIRTUAL_INCOMING_ARGS_REGNUM
! 		       || (map->integrating
! 			   && (DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer
! 			       == orig))))
  	    {
  	      /* Do the same for a block to contain any arguments referenced
  		 in memory.  */
*************** copy_rtx_and_substitute (orig, map, for_
*** 1959,1965 ****
        return map->reg_map[regno];
  
      case SUBREG:
!       copy = copy_rtx_and_substitute (SUBREG_REG (orig), map, for_lhs);
        return simplify_gen_subreg (GET_MODE (orig), copy,
  				  GET_MODE (SUBREG_REG (orig)),
  				  SUBREG_BYTE (orig));
--- 1979,1986 ----
        return map->reg_map[regno];
  
      case SUBREG:
!       copy = copy_rtx_and_substitute (SUBREG_REG (orig), map, for_lhs,
! 				      in_sibcall);
        return simplify_gen_subreg (GET_MODE (orig), copy,
  				  GET_MODE (SUBREG_REG (orig)),
  				  SUBREG_BYTE (orig));
*************** copy_rtx_and_substitute (orig, map, for_
*** 1967,1973 ****
      case ADDRESSOF:
        copy = gen_rtx_ADDRESSOF (mode,
  				copy_rtx_and_substitute (XEXP (orig, 0),
! 							 map, for_lhs),
  				0, ADDRESSOF_DECL (orig));
        regno = ADDRESSOF_REGNO (orig);
        if (map->reg_map[regno])
--- 1988,1995 ----
      case ADDRESSOF:
        copy = gen_rtx_ADDRESSOF (mode,
  				copy_rtx_and_substitute (XEXP (orig, 0),
! 							 map, for_lhs,
! 							 in_sibcall),
  				0, ADDRESSOF_DECL (orig));
        regno = ADDRESSOF_REGNO (orig);
        if (map->reg_map[regno])
*************** copy_rtx_and_substitute (orig, map, for_
*** 1995,2001 ****
  	 to (use foo) if the original insn didn't have a subreg.
  	 Removing the subreg distorts the VAX movstrhi pattern
  	 by changing the mode of an operand.  */
!       copy = copy_rtx_and_substitute (XEXP (orig, 0), map, code == CLOBBER);
        if (GET_CODE (copy) == SUBREG && GET_CODE (XEXP (orig, 0)) != SUBREG)
  	copy = SUBREG_REG (copy);
        return gen_rtx_fmt_e (code, VOIDmode, copy);
--- 2017,2024 ----
  	 to (use foo) if the original insn didn't have a subreg.
  	 Removing the subreg distorts the VAX movstrhi pattern
  	 by changing the mode of an operand.  */
!       copy = copy_rtx_and_substitute (XEXP (orig, 0), map, code == CLOBBER,
! 				      in_sibcall);
        if (GET_CODE (copy) == SUBREG && GET_CODE (XEXP (orig, 0)) != SUBREG)
  	copy = SUBREG_REG (copy);
        return gen_rtx_fmt_e (code, VOIDmode, copy);
*************** copy_rtx_and_substitute (orig, map, for_
*** 2056,2062 ****
  	    {
  	      rtx temp = force_const_mem (const_mode,
  					  copy_rtx_and_substitute (constant,
! 								   map, 0));
  
  #if 0
  	      /* Legitimizing the address here is incorrect.
--- 2079,2086 ----
  	    {
  	      rtx temp = force_const_mem (const_mode,
  					  copy_rtx_and_substitute (constant,
! 								   map, 0,
! 								   in_sibcall));
  
  #if 0
  	      /* Legitimizing the address here is incorrect.
*************** copy_rtx_and_substitute (orig, map, for_
*** 2085,2091 ****
  	  else if (GET_CODE (constant) == LABEL_REF)
  	    return XEXP (force_const_mem
  			 (GET_MODE (orig),
! 			  copy_rtx_and_substitute (constant, map, for_lhs)),
  			 0);
  	}
  
--- 2109,2116 ----
  	  else if (GET_CODE (constant) == LABEL_REF)
  	    return XEXP (force_const_mem
  			 (GET_MODE (orig),
! 			  copy_rtx_and_substitute (constant, map, for_lhs,
! 						   in_sibcall)),
  			 0);
  	}
  
*************** copy_rtx_and_substitute (orig, map, for_
*** 2149,2156 ****
  	    (GET_MODE (orig),
  	     gen_rtx_MEM (GET_MODE (XEXP (orig, 0)),
  			  copy_rtx_and_substitute (XEXP (XEXP (orig, 0), 0),
! 						   map, 0)),
! 	     copy_rtx_and_substitute (XEXP (orig, 1), map, 0));
        break;
  
  #if 0
--- 2174,2181 ----
  	    (GET_MODE (orig),
  	     gen_rtx_MEM (GET_MODE (XEXP (orig, 0)),
  			  copy_rtx_and_substitute (XEXP (XEXP (orig, 0), 0),
! 						   map, 0, in_sibcall)),
! 	     copy_rtx_and_substitute (XEXP (orig, 1), map, 0, in_sibcall));
        break;
  
  #if 0
*************** copy_rtx_and_substitute (orig, map, for_
*** 2172,2178 ****
  	  rtx equiv_loc;
  	  HOST_WIDE_INT loc_offset;
  
! 	  copy_rtx_and_substitute (SET_DEST (orig), map, for_lhs);
  	  equiv_reg = map->reg_map[REGNO (SET_DEST (orig))];
  	  equiv_loc = VARRAY_CONST_EQUIV (map->const_equiv_varray,
  					  REGNO (equiv_reg)).rtx;
--- 2197,2203 ----
  	  rtx equiv_loc;
  	  HOST_WIDE_INT loc_offset;
  
! 	  copy_rtx_and_substitute (SET_DEST (orig), map, for_lhs, in_sibcall);
  	  equiv_reg = map->reg_map[REGNO (SET_DEST (orig))];
  	  equiv_loc = VARRAY_CONST_EQUIV (map->const_equiv_varray,
  					  REGNO (equiv_reg)).rtx;
*************** copy_rtx_and_substitute (orig, map, for_
*** 2183,2196 ****
  			      force_operand
  			      (plus_constant
  			       (copy_rtx_and_substitute (SET_SRC (orig),
! 							 map, 0),
  				- loc_offset),
  			       NULL_RTX));
  	}
        else
  	return gen_rtx_SET (VOIDmode,
! 			    copy_rtx_and_substitute (SET_DEST (orig), map, 1),
! 			    copy_rtx_and_substitute (SET_SRC (orig), map, 0));
        break;
  
      case MEM:
--- 2208,2223 ----
  			      force_operand
  			      (plus_constant
  			       (copy_rtx_and_substitute (SET_SRC (orig),
! 							 map, 0, in_sibcall),
  				- loc_offset),
  			       NULL_RTX));
  	}
        else
  	return gen_rtx_SET (VOIDmode,
! 			    copy_rtx_and_substitute (SET_DEST (orig), map, 1,
! 						     in_sibcall),
! 			    copy_rtx_and_substitute (SET_SRC (orig), map, 0,
! 						     in_sibcall));
        break;
  
      case MEM:
*************** copy_rtx_and_substitute (orig, map, for_
*** 2203,2209 ****
  	  rtx constant
  	    = get_pool_constant_for_function (inlining, XEXP (orig, 0));
  
! 	  constant = copy_rtx_and_substitute (constant, map, 0);
  
  	  /* If this was an address of a constant pool entry that itself
  	     had to be placed in the constant pool, it might not be a
--- 2230,2236 ----
  	  rtx constant
  	    = get_pool_constant_for_function (inlining, XEXP (orig, 0));
  
! 	  constant = copy_rtx_and_substitute (constant, map, 0, in_sibcall);
  
  	  /* If this was an address of a constant pool entry that itself
  	     had to be placed in the constant pool, it might not be a
*************** copy_rtx_and_substitute (orig, map, for_
*** 2219,2225 ****
  
        copy = rtx_alloc (MEM);
        PUT_MODE (copy, mode);
!       XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (orig, 0), map, 0);
        MEM_COPY_ATTRIBUTES (copy, orig);
        return copy;
  
--- 2246,2253 ----
  
        copy = rtx_alloc (MEM);
        PUT_MODE (copy, mode);
!       XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (orig, 0), map, 0,
! 					        in_sibcall);
        MEM_COPY_ATTRIBUTES (copy, orig);
        return copy;
  
*************** copy_rtx_and_substitute (orig, map, for_
*** 2246,2252 ****
  
  	case 'e':
  	  XEXP (copy, i)
! 	    = copy_rtx_and_substitute (XEXP (orig, i), map, for_lhs);
  	  break;
  
  	case 'u':
--- 2274,2281 ----
  
  	case 'e':
  	  XEXP (copy, i)
! 	    = copy_rtx_and_substitute (XEXP (orig, i), map, for_lhs,
! 				       in_sibcall);
  	  break;
  
  	case 'u':
*************** copy_rtx_and_substitute (orig, map, for_
*** 2263,2269 ****
  	      for (j = 0; j < XVECLEN (copy, i); j++)
  		XVECEXP (copy, i, j)
  		  = copy_rtx_and_substitute (XVECEXP (orig, i, j),
! 					     map, for_lhs);
  	    }
  	  break;
  
--- 2292,2298 ----
  	      for (j = 0; j < XVECLEN (copy, i); j++)
  		XVECEXP (copy, i, j)
  		  = copy_rtx_and_substitute (XVECEXP (orig, i, j),
! 					     map, for_lhs, in_sibcall);
  	    }
  	  break;
  
*** integrate.h.sibcall	Tue Aug  7 16:03:13 2001
--- integrate.h	Tue Aug  7 16:17:23 2001
*************** struct inline_remap
*** 127,133 ****
  
  /* Return a copy of an rtx (as needed), substituting pseudo-register,
     labels, and frame-pointer offsets as necessary.  */
! extern rtx copy_rtx_and_substitute PARAMS ((rtx, struct inline_remap *, int));
  
  /* Return a pseudo that corresponds to the value in the specified hard
     reg as of the start of the function (for inlined functions, the
--- 127,133 ----
  
  /* Return a copy of an rtx (as needed), substituting pseudo-register,
     labels, and frame-pointer offsets as necessary.  */
! extern rtx copy_rtx_and_substitute PARAMS ((rtx, struct inline_remap *, int, int));
  
  /* Return a pseudo that corresponds to the value in the specified hard
     reg as of the start of the function (for inlined functions, the
*** unroll.c.sibcall	Tue Aug  7 16:07:03 2001
--- unroll.c	Tue Aug  7 16:07:28 2001
*************** initial_reg_note_copy (notes, map)
*** 1673,1679 ****
    PUT_REG_NOTE_KIND (copy, REG_NOTE_KIND (notes));
  
    if (GET_CODE (notes) == EXPR_LIST)
!     XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (notes, 0), map, 0);
    else if (GET_CODE (notes) == INSN_LIST)
      /* Don't substitute for these yet.  */
      XEXP (copy, 0) = copy_rtx (XEXP (notes, 0));
--- 1673,1679 ----
    PUT_REG_NOTE_KIND (copy, REG_NOTE_KIND (notes));
  
    if (GET_CODE (notes) == EXPR_LIST)
!     XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (notes, 0), map, 0, false);
    else if (GET_CODE (notes) == INSN_LIST)
      /* Don't substitute for these yet.  */
      XEXP (copy, 0) = copy_rtx (XEXP (notes, 0));
*************** copy_loop_body (loop, copy_start, copy_e
*** 2000,2006 ****
  	    }
  	  else
  	    {
! 	      pattern = copy_rtx_and_substitute (pattern, map, 0);
  	      copy = emit_insn (pattern);
  	    }
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
--- 2000,2006 ----
  	    }
  	  else
  	    {
! 	      pattern = copy_rtx_and_substitute (pattern, map, 0, false);
  	      copy = emit_insn (pattern);
  	    }
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
*************** copy_loop_body (loop, copy_start, copy_e
*** 2047,2053 ****
  	  break;
  
  	case JUMP_INSN:
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
  	  copy = emit_jump_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
--- 2047,2053 ----
  	  break;
  
  	case JUMP_INSN:
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0, false);
  	  copy = emit_jump_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
*************** copy_loop_body (loop, copy_start, copy_e
*** 2173,2179 ****
  	  break;
  
  	case CALL_INSN:
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
  	  copy = emit_call_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
--- 2173,2179 ----
  	  break;
  
  	case CALL_INSN:
! 	  pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0, false);
  	  copy = emit_call_insn (pattern);
  	  REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
  
*************** copy_loop_body (loop, copy_start, copy_e
*** 2181,2187 ****
  	     than hard registers, we need to copy it.  */
  	  CALL_INSN_FUNCTION_USAGE (copy)
  	    = copy_rtx_and_substitute (CALL_INSN_FUNCTION_USAGE (insn),
! 				       map, 0);
  
  #ifdef HAVE_cc0
  	  if (cc0_insn)
--- 2181,2187 ----
  	     than hard registers, we need to copy it.  */
  	  CALL_INSN_FUNCTION_USAGE (copy)
  	    = copy_rtx_and_substitute (CALL_INSN_FUNCTION_USAGE (insn),
! 				       map, 0, false);
  
  #ifdef HAVE_cc0
  	  if (cc0_insn)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]