O0 cleanup_cfg vs debuggability
James E Wilson
wilson@specifixinc.com
Sat Aug 7 23:52:00 GMT 2004
Olivier Hainque wrote:
> This optimization may affect debuggability even at O0, which is a bit
> annoying. For instance, on x86-linux a breakpoint on the "break" statement in
> the code below:
In gcc-3.4, I think you can solve this by redefining what a forwarder
block is, or how we handle them. See forwarder_block_p in cfganal.c.
Normally, a forwarder block is something that contains no active insns
other than a branch, and we optimize them away whenever possible to
simplify the cfg. However, if we want full debugging info, then a block
that contains a line number note should not be considered a forwarder
block, or else, we should not be optimizing away forwarder blocks. The
rest of what the jump pass is doing is probably not relevant to your
problem.
In gcc-3.5 however, we are already screwed before the first rtl pass.
As a side effect of the gimple to rtl transformation, we don't bother to
emit the empty block that is only needed to hold the line number note.
So we would have to fix the gimple to rtl transformation first to
preserve this info, then fix the cleanup_cfg code to not optimize away
blocks that contain line number notes. Try compiling with -da
-fdump-tree-all and look at the last tree dump and the first rtl dump.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list