This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] basic_block.h: Move goto_locus from edge to basic_block.
- From: Steven Bosscher <stevenb at suse dot de>
- To: law at redhat dot com
- Cc: kazu at cs dot umass dot edu, gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Nov 2004 10:01:52 +0100 (CET)
- Subject: Re: [patch] basic_block.h: Move goto_locus from edge to basic_block.
- Organization: SuSE Linux AG
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