This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] MIN/MAX_EXPR transform in phiopts
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, stevenb at suse dot de
- Date: Sun, 13 Mar 2005 20:17:25 +0100
- Subject: Re: [patch] MIN/MAX_EXPR transform in phiopts
- References: <20050311085213.GA7476@atrey.karlin.mff.cuni.cz> <42330981.2090706@redhat.com>
Hello,
> On 03/11/05 03:52, Zdenek Dvorak wrote:
>
> >! ENTRY_BLOCK_PTR->flags |= BB_VISITED;
> >! FOR_EACH_BB (x)
> >! {
> >! if (x->flags & BB_VISITED)
> >! continue;
> >!
> No. BB_VISITED should not be used by passes:
>
> /* Masks for basic_block.flags.
>
> BB_VISITED should not be used by passes, it is used internally by
> dfs_enumerate_from.
>
> BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout
> the compilation, so they are never cleared.
>
> All other flags may be cleared by clear_bb_flags(). It is generally
> a bad idea to rely on any flags being up-to-date. */
given that blocks_in_phiopt_order does not call dfs_enumerate_from and
clears the BB_VISITED flag, this usage is OK. I may change it to using
sbitmap. Although having a flag reserved for a single function is a bit
weird; perhaps it might be better to change the wording of the comment
to
"BB_VISITED should not be used by passes. It is used internally by
simple utility functions (like dfs_enumerate_from and
blocks_in_phiopt_order) and it is kept zeroed anywhere outside these
functions."
Zdenek