https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120637

--- Comment #2 from Antony Lewis <antony at cosmologist dot info> ---
Gemini and o3-pro, after some iteration, think this bug is due to reusing stale
cache pointers, which seems plausible to me and fits the erratic behaviour. 
FWIW there is description and possible workaround at

https://github.com/cmbant/gcc/pull/2

Personally, as a total gcc-nonexpert, it's not clear to me why this cache is
needed at all: for allocatables, there should never be two ways to access the
same instance via allocatable references, so would have though the problematic
(incorrect) "return" could simplify be removed along with the other reuse
caching, since the finalization tree should never repeat frees if the logic is
consistent. Was this a workaround for earlier finalization logic bugs?

Reply via email to