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]

Re: Find more shrink-wrapping opportunities


On Wed, Oct 5, 2011 at 10:48 PM, Bernd Schmidt <bernds@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.

Ciao!
Steven


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