Hi! Without this patch, we emit in .debug_macro with -g3 -xc - a .file N "" directive which makes e.g. readelf unhappy. Elsewhere, we handle "" filename as "<stdin>", so this patch does that too for .debug_macro.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2019-11-27 Jakub Jelinek <ja...@redhat.com> PR debug/92664 * dwarf2out.c (lookup_filename): Use "<stdin>" instead of "". --- gcc/dwarf2out.c.jj 2019-10-17 08:44:08.594363833 +0200 +++ gcc/dwarf2out.c 2019-11-26 12:35:46.419184285 +0100 @@ -27118,6 +27118,9 @@ lookup_filename (const char *file_name) if (!file_name) return NULL; + if (!file_name[0]) + file_name = "<stdin>"; + dwarf_file_data **slot = file_table->find_slot_with_hash (file_name, htab_hash_string (file_name), INSERT); Jakub