This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 29609, being able to set a breakpoint on goto/continue/break
On 4/30/07, Tristan Gingold <gingold@belfast.act-europe.fr> wrote:
On Thu, Apr 26, 2007 at 11:04:58PM +0200, Steven Bosscher wrote:
> I looked at this bug a bit too. Did you check that we use the goto_locus
> on the edge? I wonder whether this problem goes away if you'd teach
> cfgcleanup to set goto_locus when removing a forwarder. That would IMHO
> be a cleaner solution.
No, we don't use it.
However I still fail to understand how the problem will goes away using this
approach.
Read the fine comment in basic_block.h:
/* Location of any goto implicit in the edge, during tree-ssa. */
source_locus goto_locus;
Then look at how this is used in disband_implicit_edges.
The reason of this problem is the merge of the goto statement in the if
statement:
if (cond)
goto lab;
is transformed into:
eval cond; jump_if lab;
What the heck is jump_if?
When the "goto lab" is merged with the COND_EXPR, set goto_locus to
the EXPR_LOCUS (or EXPR_LOCATION with USE_MAPPED_LOCATION) of the
"goto lab" statement.
We cannot set a breakpoint on the 'goto' because there is no more 'goto' in
the transformed code. My approach was to force the creation of a BB for
the goto statement.
And your approach is wrong if using goto_locus works instead.
Gr.
Steven