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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so we populate debug_line_str_hash via dwarf2out_early_finish LTO debug
output

#0  output_line_string (form=DW_FORM_line_strp, 
    str=0x7fffffffeb19 "/abuild/rguenther/obj-sccvn-g/gcc", 
    entry_kind=0x21a415a "Directory Entry", idx=0)
    at /space/rguenther/src/gcc-sccvn/gcc/dwarf2out.c:12104
#1  0x0000000000d66929 in output_file_names ()
    at /space/rguenther/src/gcc-sccvn/gcc/dwarf2out.c:12295
#2  0x0000000000d6785a in output_line_info (prologue_only=true)
    at /space/rguenther/src/gcc-sccvn/gcc/dwarf2out.c:12679
#3  0x0000000000d9cead in dwarf2out_early_finish (
    filename=0x7fffffffe299 "t.ii")
    at /space/rguenther/src/gcc-sccvn/gcc/dwarf2out.c:32051

where the string form is decided on by

      if (DWARF5_USE_DEBUG_LINE_STR)
        str_form = DW_FORM_line_strp;

without -flto output_filenames isn't called.  That's possibly because
in dwarf2out_finish we call it conditional on

  if (! output_asm_line_debug_info ())  
    output_line_info (false);

But for early debug we _do_ want a .debug_line section with filenames
and all.  That means all *ASM_LINE_DEBUG_INFO stuff doesn't apply here,
in particular the section needs to be created independent of that.

Reply via email to