https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61767
--- Comment #9 from janus at gcc dot gnu.org --- (In reply to janus from comment #7) > This alternative patch fixes the ICE as well: > [...] > It avoids calling generate_finalization_wrapper for non-finalizable types at > all, and thus might even be preferable over the previous patch (provided it > regtests fine, which I don't know yet). I think this is wrong. In fact we do not only use calls to a _final routine for actual finalization, but also for polymorphic deallocation (see PR46321)! Thus: The patch in comment #7 should be discarded, and comment #5 is the way to go here.