https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82996
--- Comment #8 from neil.n.carlson at gmail dot com --- > If I remove 'elemental' for 'subroutine foo_destroy', the segfault is gone. In that case the final procedure doesn't match the array component and wouldn't be called. I suspect that is why the segfault is gone.