[RFC, PATCH] Getting the live registers correct when caller-saves are inserted by reload

Ulrich Weigand uweigand@de.ibm.com
Tue Dec 4 13:46:00 GMT 2007


Hans-Peter Nilsson wrote:

>I fixed a new formatting issues (spacing in comment and 80
>column wrap) and changed the regno test to be a bit safer, the
>same as in the loop above this code.  As follows:

> +      /* If CHAIN->INSN is a call, then the registers which contain
> +	 the arguments to the function are live in the new insn.  */
> +      if (CALL_P (chain->insn))
> +	{
> +	  for (link = CALL_INSN_FUNCTION_USAGE (chain->insn);
> +	       link != NULL_RTX;
> +	       link = XEXP (link, 1))
> +	    {
> +	      rtx arg = XEXP (link, 0);
> +
> +	      if (GET_CODE (arg) == USE)
> +		{
> +		  rtx reg = XEXP (arg, 0);
> +
> +		  if (REG_P (reg))
> +		    {
> +		      int i, regno = REGNO (reg);
> +		      if (regno >= FIRST_PSEUDO_REGISTER)
> +			regno = reg_renumber[regno];
> +		      if (regno < 0)
> +			continue;

I understand CALL_INSN_FUNCTION_USAGE can only contain hard
registers anyway, so handling pseudos should be unnecessary
here in the first place ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list