This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Find more shrink-wrapping opportunities
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Oct 2011 23:23:52 +0200
- Subject: Re: Find more shrink-wrapping opportunities
- References: <4E8CC286.80107@codesourcery.com>
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