Thoughts about semantics of BB_VISITED

Steven Bosscher stevenb@suse.de
Fri Jan 7 21:19:00 GMT 2005


On Friday 07 January 2005 21:44, Zdenek Dvorak wrote:
> what about "dfs_enumerate_from does not work unless the marks are clear"
> is not clear?  Either you call dfs_enumerate_from in situation where
> all marks are clear, and then it does not change anything.

What you are basically saying is that no pass should ever use
BB_VISITED.

I would have no problems with that, the uses of BB_VISITED that
are in mainline (tree-ssa-pre.c, regrename.c, sched-rgn.c) are
easily replaced with an sbitmap, and in fact that is probably
even faster than using the flag because you need the extra pass
over all basic blocks to clean BB_VISITED again.

On the other hand, even if it is clear that "dfs_enumerate_from
not work unless the marks are clear", that does not make it
right for that function to set and clear that flag if BB_VISITED
is supposed to be available to passes.

> Or you call 
> it when some of the marks are set, and then you have created a bug in
> gcc.

If there is a bug in gcc, then it is there because *you* have
taken an existing BB flag and turned it into one that is basically
private to cfganal.cm, without documenting that.

Gr.
Steven




More information about the Gcc mailing list