https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91027
--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> --- Hi, this patch triggers another confusion in ipa-devirt. It tries to build type inheritnace graph but since D frotnend produces only functions with DECL_VIRTUAL but no BINFOs and other things it segfaults eventually. Working around it makes it to work. So this adds new question why D frontend needs to set DECL_VIRTUAL? Honza Index: tree.c =================================================================== --- tree.c (revision 273084) +++ tree.c (working copy) @@ -6140,6 +6142,11 @@ find_decls_types_in_var (varpool_node *v void assign_assembler_name_if_needed (tree t) { + /* D frontend sets assembler name of TYPE_DECLs. + We later use them to maintain ODR infrmation for C++, but these + names are always computed by decl_assembler_name call below. */ + if (TREE_CODE (t) == TYPE_DECL) + SET_DECL_ASSEMBLER_NAME (t, NULL); if (need_assembler_name_p (t)) { /* When setting DECL_ASSEMBLER_NAME, the C++ mangler may emit