Hi, this patch fixes ICE in free_lang_data compiling lto8.adb. The fix is bit symptomatic becuase type_with_linkage_p should return false for Ada types. Perhaps adding explicit flag to DECL_NAME would make sense but it can wait for next stage1.
The fix works because at this stage of free_lang_data all mangled names must be computed and thus it is cheper to test presence of DECL_ASSEMBLER_NAME anyway. Bootstrapped/regtested x86_64-linux, comitted. PR lto/87957 * tree.c (fld_simplified_type_name): Use DECL_ASSEMBLER_NAME_SET_P instead of type_with_linkage. Index: tree.c =================================================================== --- tree.c (revision 268722) +++ tree.c (working copy) @@ -5152,7 +5152,8 @@ fld_simplified_type_name (tree type) /* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the TYPE_DECL if the type doesn't have linkage. this must match fld_ */ - if (type != TYPE_MAIN_VARIANT (type) || ! type_with_linkage_p (type)) + if (type != TYPE_MAIN_VARIANT (type) + || !DECL_ASSEMBLER_NAME_SET_P (TYPE_NAME (type))) return DECL_NAME (TYPE_NAME (type)); return TYPE_NAME (type); }