https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84213
Pierre-Marie de Rodat <derodat at adacore dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |derodat at adacore dot com --- Comment #7 from Pierre-Marie de Rodat <derodat at adacore dot com> --- Hello, (In reply to Richard Biener from comment #6) > I'm quite sure the rev. is responsible for similar Ada -flto -g failures. > We simply may _not_ add location attributes early. I did not have a deep look at this, so I’m asking: is it possible to add it late, then? > So I think we need to revert this patch and instead make sure those > Ada variables do not get removed? Like by marking them with > DECL_PRESERVE_P? > > Trying that (figuring where those decls are created). Pierre-Marie, > maybe you can help here as well. IIRC, what my r248792 is about is not to preserve the DW_TAG_varible itself (it was already present in the DWARF output before), but to make sure we have a location for it: if we have a DW_TAG_variable entry without a DW_AT_location attribute, GDB will consider that the variable does not exist and thus we’ll loose debuggability in Ada.