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: [patch] MIN/MAX_EXPR transform in phiopts


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


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