https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97630
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The least resistance attempt to fix it would be to keep track of allocated SLP trees in _slp_tree::operator new/delete using a hash_set<> for example and call the DTOR on still allocated ones when destroying the alloc-pool. A double-linked list of all allocated nodes would work as well. Otherwise each vect_free_slp_tree would need to check whether it was the last entry into a cycle which would be quite expensive. Tracking cycle [entries] separately is somewhat difficult since via vectorizable_* we can later break cycles at arbitrary places so we can't use weak references for backedges because what and what is not a backedge can change.