https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77985
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
But also:
/* Add the name for the main input file now. We delayed this from
dwarf2out_init to avoid complications with PCH. */
add_name_attribute (comp_unit_die (), remap_debug_filename (filename));
if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir)
add_comp_dir_attribute (comp_unit_die ());
else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL)
{
bool p = false;
file_table->traverse<bool *, file_table_relative_p> (&p);
if (p)
add_comp_dir_attribute (comp_unit_die ());
}
where the file table seems to contain "<built-in>".
Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 241148)
+++ dwarf2out.c (working copy)
@@ -26422,7 +26422,8 @@ int
file_table_relative_p (dwarf_file_data **slot, bool *p)
{
struct dwarf_file_data *d = *slot;
- if (!IS_ABSOLUTE_PATH (d->filename))
+ if (!IS_ABSOLUTE_PATH (d->filename)
+ && d->filename[0] != '<')
{
*p = true;
return 0;
fixes this.