https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119349
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andre Vehreschild <ve...@gcc.gnu.org>: https://gcc.gnu.org/g:0f344846a62c8863375909d8d6b435b4b5fd35a0 commit r15-8481-g0f344846a62c8863375909d8d6b435b4b5fd35a0 Author: Andre Vehreschild <ve...@gcc.gnu.org> Date: Thu Mar 20 13:37:21 2025 +0100 Fortran: Fix double free on polymorphic array dummy argument [PR119349] Calling elemental routines with polymorphic formals leads to generation of a temporary polymorphic variable and code for its deallocation. Sourcing this element from an array constructor the latter now is prevented from generating a second deallocation. PR fortran/119349 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Prevent deallocation of array temporary for polymorphic temporary argument. gcc/testsuite/ChangeLog: * gfortran.dg/class_79.f90: New test.