[Bug debug/105161] variable constant-folded in its uses appears as optimized out depending on where it is assigned

aoliva at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 8 17:26:00 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105161

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Debug binds in edges was something I considered for some time, but concluded it
would be unlikely to bring useful debug information: the confluence operator
for debug-bind-capable decls during var-tracking dataflow analysis intersects
incoming bindings, so whatever we placed in a single edge would likely end up
discarded.  Conditional locations might preserve that, but it's not clear those
would be representable in DWARF.

I suppose a path for improvement would be, instead of dropping the debug binds
or adding resets to all blocks, to introduce some analysis to come up with a
better bind, using e.g. PHI nodes in the outgoing blocks.  I'm afraid I don't
have a clue as to how to implement that efficiently, or at all, though :-/


More information about the Gcc-bugs mailing list