More flow cleanup

Bernd Schmidt crux@pool.informatik.rwth-aachen.de
Thu Oct 15 03:36:00 GMT 1998


>   > @@ -1807,6 +1791,16 @@ propagate_block (old, first, last, final
>   >  	    ;
>   >  	  else
>   >  	    {
>   > +	      /* Any regs live at the time of a call instruction
>   > +		 must not go in a register clobbered by calls.
>   > +		 Find all regs now live and record this for them.  */
>   > +
>   > +	      if (GET_CODE (insn) == CALL_INSN && final)
>   > +		EXECUTE_IF_SET_IN_REG_SET (old, 0, i,
>   > +					   {
>   > +					     REG_N_CALLS_CROSSED (i)++;
>   > +					   });
>   > +
>   >  	      /* LIVE gets the regs used in INSN;
>   >  		 DEAD gets those set by it.  Dead insns don't make anything
>   >  		 live.  */
> Does't this code belong after we update the life information for a CALL.
> Ie, doesn't it belong where you deleted code in the next hunk?
> 
>   > @@ -1871,44 +1865,13 @@ propagate_block (old, first, last, final
>   >  	      AND_COMPL_REG_SET (old, dead);
>   >  	      IOR_REG_SET (old, live);
>   >  
>   > -	      if (GET_CODE (insn) == CALL_INSN && final)
>   > -		{
>   > -		  /* Any regs live at the time of a call instruction
>   > -		     must not go in a register clobbered by calls.
>   > -		     Find all regs now live and record this for them.  */
>   > -
>   > -		  register int *p = regs_sometimes_live;
>   > -
>   > -		  for (i = 0; i < sometimes_max; i++, p++)
>   > -		    if (REGNO_REG_SET_P (old, *p))
>   > -		      REG_N_CALLS_CROSSED (*p)++;
>   > -		}

Neither place would match the old behaviour exactly.  Note that the old code
gets its candidate pseudos from sometimes_max, which at that point still
contains the state before the insn, but tests against OLD (which already
contains the state after the insn).  Thus, with the old code, any pseudo
registers which are set during the call would not be affected (since OLD
no longer contains them).  If the new code is placed at the same point,
it would additionally consider pseudos which are used in the call; if it
is placed above, it does not consider the pseudos set in the call.

As far as I know, call insns don't set pseudos; they set the hard return
register and maybe the stack pointer.  Thus, moving the code upwards before
the update of OLD should have no effect.


Bernd





More information about the Gcc-patches mailing list