This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Patch for PR 22057
Richard Henderson <email@example.com> writes:
> On Wed, Jul 13, 2005 at 12:47:42PM -0700, Ian Lance Taylor wrote:
> > I looked into various possibilities of preserving the line number when
> > the forwarding block was removed, but then ...
> ... forgot that fixing this properly might help optimized debugging? ;-)
> What kinds of things did you try? I was thinking that the forwarder
> block optimization might copy the line number of the goto being
> eliminated as well. That would fix this test case at any rate; I'm
> not sure what other sort of effects it would have.
The problem boils down to deciding which line number to use on the
edge which you redirect around the forwarder block: the one you
already have on the existing edge, or the one from the edge which you
are replacing. I was starting to play around with heuristics like "is
either of these line numbers used by some other statement" when I
decided I was being silly. I didn't see an obvious way to decide
which way was going to give me better debugging information.
As far as I can see the correct fix, for some definition of correct,
would be to introduce some way of having multiple line numbers on an
edge, and thus presumably on an expression node. That would at least
let the debugger map from a line to a location in the program,
although the reverse mapping would still be potentially confusing.