This is the mail archive of the 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] basic_block.h: Move goto_locus from edge to basic_block.

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.

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.


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