https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92386
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-11-06 CC| |edlinger at gcc dot gnu.org, | |jason at gcc dot gnu.org, | |rguenth at gcc dot gnu.org, | |tromey at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. The issue is that those free-flow variables are "live" at the start of the containing DW_TAG_lexical_block which spans its natural PC range. I believe this is a defect in DWARF not being able to represent C99/C++ here. The only chance GCC has here is to add "fake" lexical blocks starting at every free-flow variable declaration and ending at the end of the containing lexical block. Once we generate debug info all the original information is already lost. I fear that doing this blows up memory use and debuginfo size. It's also bad style to shadow a variable in a way so that two are live at different points in the same lexical scope - this probably deserves a warning and should be considered bad style?