Simply ignoring the possibility of reference counting seems to match up with
corresponding code in eh_throw.cc __gxx_exception_cleanup?
Can this possibly be correct?
r~
diff --git a/libstdc++-v3/libsupc++/eh_tm.cc b/libstdc++-v3/libsupc++/eh_tm.cc
index f5815a1..a646102 100644
--- a/libstdc++-v3/libsupc++/eh_tm.cc
+++ b/libstdc++-v3/libsupc++/eh_tm.cc
@@ -45,7 +45,9 @@ free_any_cxa_exception (_Unwind_Exception *eo)
__cxa_free_dependent_exception (dep);
}
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
if (__sync_sub_and_fetch (&h->referenceCount, 1) == 0)
+#endif
__cxa_free_exception (h + 1);
}