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

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so C++ has

  else if ((DECL_NAME (decl) == NULL_TREE)
           && TREE_CODE (decl) == NAMESPACE_DECL)
    dump_decl (cxx_pp, decl, TFF_PLAIN_IDENTIFIER | TFF_UNQUALIFIED_NAME);

and thus "copes" with namespaces without a name.  I wonder if we want
pubnames late at all.  For darwin and other targets with "crippled"
early LTO support (read: no support) this means we'd not generate those
lookup entries.

Since we output_pubtables only from dwarf2out_finish (why?) we don't
get those into early debug.  Sth to investigate.

The ICE can probably be fixed with the following - can you test that?

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index a1b5a5eaf19..cd2e889a8cc 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11074,7 +11074,9 @@ output_comp_unit (dw_die_ref die, int output_if_empty,
 static inline bool
 want_pubnames (void)
 {
-  if (debug_info_level <= DINFO_LEVEL_TERSE)
+  if (debug_info_level <= DINFO_LEVEL_TERSE
+      /* Names and types go to the early debug part only.  */
+      || in_lto_p)
     return false;
   if (debug_generate_pub_sections != -1)
     return debug_generate_pub_sections;

Reply via email to