[PATCH] Fix PR 29609, being able to set a breakpoint on goto/continue/break

Tristan Gingold gingold@belfast.act-europe.fr
Mon Apr 30 10:08:00 GMT 2007


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.

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;
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.

Tristan.



More information about the Gcc-patches mailing list