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

--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #12)
> 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)

FWIW, I've implemented the GCC part of the support (it needs a bit of tidying
for posting, but [probably] not a stage #4 thing).  Also discussed the required
support in dsymutil with one of the devs (there seems no objection to doing
this, in principle)... so it's "when" rather than "if".

... progress on new features and enhancements for Darwin will go quicker if we
can squish the codegen and testsuite bugs (which is where the effort is going
at present) ;)

> 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.

my (limited) understanding of the purpose is to improve startup time for debug
sessions, so possibly relevant outside of darwin?

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

yes, that fixes it (only tested c++ asan).

> 
> 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