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]
Other format: [Raw text]

last libcall patch


Jan, did you actually bootstrap with the patch you installed?
Perhaps things manifest differently on Alpha, but I'm getting
bootstrap errors due to sequences being left open.

I'm testing the following.


r~



Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.217
diff -c -p -d -r1.217 calls.c
*** calls.c	2001/12/23 00:10:43	1.217
--- calls.c	2001/12/23 07:45:12
*************** expand_call (exp, target, ignore)
*** 2937,2945 ****
  	    valreg = hard_function_value (TREE_TYPE (exp), fndecl, (pass == 0));
  	}
  
-       if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
-         flags &= ~ECF_LIBCALL_BLOCK;
- 
        /* Precompute all register parameters.  It isn't safe to compute anything
  	 once we have started filling any specific hard regs.  */
        precompute_register_parameters (num_actuals, args, &reg_parm_seen);
--- 2937,2942 ----
*************** expand_call (exp, target, ignore)
*** 3071,3102 ****
  	 we have no way to move such values into a pseudo register.  */
        if (pass && (flags & ECF_LIBCALL_BLOCK))
  	{
- 	  rtx note = 0;
- 	  rtx temp = gen_reg_rtx (GET_MODE (valreg));
  	  rtx insns;
  
! 	  /* Mark the return value as a pointer if needed.  */
! 	  if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
! 	    mark_reg_pointer (temp, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
  
! 	  /* Construct an "equal form" for the value which mentions all the
! 	     arguments in order as well as the function name.  */
! 	  for (i = 0; i < num_actuals; i++)
! 	    note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note);
! 	  note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
  
! 	  insns = get_insns ();
! 	  end_sequence ();
  
! 	  if (flags & ECF_PURE)
! 	    note = gen_rtx_EXPR_LIST (VOIDmode,
! 	       gen_rtx_USE (VOIDmode,
! 			    gen_rtx_MEM (BLKmode,
! 				    	 gen_rtx_SCRATCH (VOIDmode))), note);
  
! 	  emit_libcall_block (insns, temp, valreg, note);
  
! 	  valreg = temp;
  	}
        else if (pass && (flags & ECF_MALLOC))
  	{
--- 3068,3112 ----
  	 we have no way to move such values into a pseudo register.  */
        if (pass && (flags & ECF_LIBCALL_BLOCK))
  	{
  	  rtx insns;
  
! 	  if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
! 	    {
! 	      insns = get_insns ();
! 	      end_sequence ();
! 	      emit_insns (insns);
! 	    }
! 	  else
! 	    {
! 	      rtx note = 0;
! 	      rtx temp = gen_reg_rtx (GET_MODE (valreg));
  
! 	      /* Mark the return value as a pointer if needed.  */
! 	      if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
! 		mark_reg_pointer (temp,
! 				  TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
  
! 	      /* Construct an "equal form" for the value which mentions all the
! 		 arguments in order as well as the function name.  */
! 	      for (i = 0; i < num_actuals; i++)
! 		note = gen_rtx_EXPR_LIST (VOIDmode,
! 					  args[i].initial_value, note);
! 	      note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
  
! 	      insns = get_insns ();
! 	      end_sequence ();
  
! 	      if (flags & ECF_PURE)
! 		note = gen_rtx_EXPR_LIST (VOIDmode,
! 			gen_rtx_USE (VOIDmode,
! 				     gen_rtx_MEM (BLKmode,
! 						  gen_rtx_SCRATCH (VOIDmode))),
! 			note);
  
! 	      emit_libcall_block (insns, temp, valreg, note);
! 
! 	      valreg = temp;
! 	    }
  	}
        else if (pass && (flags & ECF_MALLOC))
  	{
*************** emit_library_call_value_1 (retval, orgfu
*** 4021,4028 ****
    NO_DEFER_POP;
    valreg = (mem_value == 0 && outmode != VOIDmode
  	    ? hard_libcall_value (outmode) : NULL_RTX);
-   if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
-     flags &= ~ECF_LIBCALL_BLOCK;
  
    /* Stack must be properly aligned now.  */
    if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))
--- 4031,4036 ----
*************** emit_library_call_value_1 (retval, orgfu
*** 4078,4106 ****
       we have no way to move such values into a pseudo register.  */
    if (flags & ECF_LIBCALL_BLOCK)
      {
-       rtx note = 0;
-       rtx temp = gen_reg_rtx (GET_MODE (valreg));
        rtx insns;
-       int i;
  
!       /* Construct an "equal form" for the value which mentions all the
! 	 arguments in order as well as the function name.  */
!       for (i = 0; i < nargs; i++)
! 	note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
!       note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
  
!       insns = get_insns ();
!       end_sequence ();
  
!       if (flags & ECF_PURE)
! 	note = gen_rtx_EXPR_LIST (VOIDmode,
! 	   gen_rtx_USE (VOIDmode,
! 			gen_rtx_MEM (BLKmode,
! 				     gen_rtx_SCRATCH (VOIDmode))), note);
  
!       emit_libcall_block (insns, temp, valreg, note);
  
!       valreg = temp;
      }
    pop_temp_slots ();
  
--- 4086,4125 ----
       we have no way to move such values into a pseudo register.  */
    if (flags & ECF_LIBCALL_BLOCK)
      {
        rtx insns;
  
!       if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
! 	{
! 	  insns = get_insns ();
! 	  end_sequence ();
! 	  emit_insns (insns);
! 	}
!       else
! 	{
! 	  rtx note = 0;
! 	  rtx temp = gen_reg_rtx (GET_MODE (valreg));
! 	  int i;
  
! 	  /* Construct an "equal form" for the value which mentions all the
! 	     arguments in order as well as the function name.  */
! 	  for (i = 0; i < nargs; i++)
! 	    note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
! 	  note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
  
! 	  insns = get_insns ();
! 	  end_sequence ();
  
! 	  if (flags & ECF_PURE)
! 	    note = gen_rtx_EXPR_LIST (VOIDmode,
! 			gen_rtx_USE (VOIDmode,
! 				     gen_rtx_MEM (BLKmode,
! 						  gen_rtx_SCRATCH (VOIDmode))),
! 			note);
  
! 	  emit_libcall_block (insns, temp, valreg, note);
! 
! 	  valreg = temp;
! 	}
      }
    pop_temp_slots ();
  


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