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

--- Comment #1 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Created attachment 61747
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61747&action=edit
possible fix

Sorry for the breakage.  The issue is this assertion in assemble_name_resolve:

      mark_referenced (id);
      ultimate_transparent_alias_target (&id);
      if (id != id_orig)
        name = IDENTIFIER_POINTER (id);
      gcc_assert (! TREE_CHAIN (id));

With my change, not just IDENTIFIER_TRANSPARENT_ALIAS identifiers can have
TREE_CHAINs.  It appears that perhaps only platforms with ASM_OUTPUT_WEAKREF
undefined will run into this.

Unfortunately I don't really have much capacity to look into this for the next
few weeks, but I imagine something like the attached patch may work.  (And
adding some other assertions to validate that my assumption that a
IDENTIFIER_INTERNAL_P will never be a transparent alias.)

At some point I can try building a cross-compiler to verify, but otherwise
please feel free to submit (a version of) this patch if it resolves the issue.

Reply via email to