[PATCH]: Replace backend dataflow

Kenneth Zadeck zadeck@naturalbridge.com
Thu Jan 5 01:12:00 GMT 2006


>   
>> +#ifdef EH_USES
>> +  if ((df->flags & DF_HARD_REGS)
>> +      && has_eh_preds (bb))
>> +    {
>> +      unsigned int i;
>> +      for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
>> +	if (EH_USES (i))
>> +	  {
>> +	    rtx use = df_reg_use_gen (i);
>> +	    df_ref_create_structure (dflow, regno_reg_rtx[i], 
>> +				     &XEXP (use, 0), NULL, EXIT_BLOCK_PTR,
>> +				     DF_REF_REG_USE, 
>> +				     DF_REF_ARTIFICIAL | DF_REF_AT_TOP);
>> +	  }
>> +    }
>> +#endif
>>     
>
> I don't think this is right (though maybe I said otherwise on IRC).
> The only target which actually defines EH_USES is ia64.  I think that
> if EH_USES is set, it means that the register must be valid when an
> exception is taken.  Therefore what matters for EH_USES is not
> has_eh_preds, but has_eh_succs.
>
>   
What we talked about on irc was modeling the def side of this in the
entry block.

This code is to model the use side which occurs when and exception is
raised.

I really think that this code is correct (except removal of the
df_reg_use_gen).  According to the documentation, these registers are
set up on entry to the function and are used in the exception handling
code that is executed along the edge.

This code is putting in a artificial ref for the use at the TOP of the
block that receives the exception.  It is too cumbersome to actually put
the ref on the edge.  We could either model this at the top of the
receiver block or the bottom of the sender block.

The bottom of the sender block is problematic because not all out-edges
of the a block are eh-edges.  However, it is true that all edges into a
block are either eh-edges or none of them are eh-edges.  Thus, we can
model this at the top of the eh-receiver for all of the edges at once.

Kenny






More information about the Gcc-patches mailing list