https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87089
--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Jason, I can avoid the ICE by simply not simplifying contexts for all C++ destructors. Index: tree.c =================================================================== --- tree.c (revision 268728) +++ tree.c (working copy) @@ -5772,7 +5772,7 @@ free_lang_data_in_decl (tree decl, struc these are needed by devirtualization. */ if (TREE_CODE (decl) != FIELD_DECL && ((TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL) - || !DECL_VIRTUAL_P (decl))) + || (!DECL_VIRTUAL_P (decl) && !DECL_CXX_DESTRUCTOR_P (decl)))) DECL_CONTEXT (decl) = fld_decl_context (DECL_CONTEXT (decl)); } but it seems to me this is more a workaround - if the destructor is virtual, it should have VIRTUAL flag set. Or is there any reason we want to handle it differently then any other normal virutal function in the middle-end?