On 10/05/11 23:23, Steven Bosscher wrote:
> On Wed, Oct 5, 2011 at 10:48 PM, Bernd Schmidt <ber...@codesourcery.com> 
> wrote:
>> Bootstrapped and tested on i686-linux. Ok?
> 
>> +/* Return true if BB has any active insns.  */
>> +static bool
>> +bb_active_p (basic_block bb)
>> +{
>> +  rtx label;
>> +
>> +  /* Test whether there are active instructions in the last block.  */
>> +  label = BB_END (bb);
>> +  while (label && !LABEL_P (label))
>> +    {
>> +      if (active_insn_p (label))
>> +    break;
>> +      label = PREV_INSN (label);
>> +    }
>> +  return BB_HEAD (bb) != label || !LABEL_P (label);
>> +}
> 
> This assumes that all basic blocks start with a label, I don't think
> that's true. It seems better to use FOR_BB_INSNS_REVERSE here.

It's the same code as before... and if you get a block without a label
and without active insns, then cfgcleanup hasn't done its job.


Bernd

Reply via email to