[patch] basic_block.h: Move goto_locus from edge to basic_block.

Steven Bosscher stevenb@suse.de
Tue Nov 9 09:18:00 GMT 2004


Jeff wrote:
> It seems to me that the GOTO_LOCUS should remain a property of the
> edge as we may have blocks with multiple outgoing implicit gotos
> (COND_EXPRs for example if we get to a point where we're ready to
> clear the true/false labels).

Neh.  Kazu just explained the patch the wrong way, or he
misunderstood my point.

goto_locus is for *explicit* gotos.  Not implicit, we *only*
have implicit gotos.  That's the whole point.  An explicit
goto in the source code is removed when we build the tree CFG,
but for gcov we want to put a counter on the line where the
explicit goto was.  So we need to put the locus somewhere.

Now, rth put the locus on the edge.  But think about it:
A block that ends in an explicit goto is a block that can have
at most one outgoing edge.  So puting the locus in edge_def
is really wasteful: The field is almost never used (explicit
gotos are pretty rare), and usually there are far more edges
than basic blocks.

So,
1) For any given block there can be at most one explicit goto
2) Such a block can have at most one outgoing edge

Makes sense to not put the locus on the edge then, but in the
basic block where the explicit goto was.

Gr.
Steven






More information about the Gcc-patches mailing list