https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98638
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- I am testing the following which fixes the ICE (but not the bogus leak of SSA names into global tree structs) diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index c293cc44189..51a26d2fce1 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -102,6 +102,14 @@ init_ssanames (struct function *fn, int size) void fini_ssanames (struct function *fn) { + unsigned i; + tree name; + /* Some SSA names leak into global tree data structures so we can't simply + ggc_free them. But make sure to clear references to stmts since we now + ggc_free the CFG itself. */ + FOR_EACH_VEC_SAFE_ELT (SSANAMES (fn), i, name) + if (name) + SSA_NAME_DEF_STMT (name) = NULL; vec_free (SSANAMES (fn)); vec_free (FREE_SSANAMES (fn)); vec_free (FREE_SSANAMES_QUEUE (fn));