[Bug fortran/125391] [16/17 Regression] ICE on derived type (with final) array assignment inside polymorphic class since r16-2567

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat May 23 14:00:45 GMT 2026


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

--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:c8ea9199ba0a65eb591557632f86a249e3a3f117

commit r16-8958-gc8ea9199ba0a65eb591557632f86a249e3a3f117
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Sat May 23 14:40:19 2026 +0100

    Fortran: Fix ICE in allocatable finalization expression [PR125391]

    2026-05-23  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/125391
            * trans.cc (gfc_assignment_finalizer_call): For finalization of
            allocatable and pointer lhs before assignment, gfc_conv_expr
            should be used with se.descriptor_only. This avoids implicit of
            set_factored_descriptor_value by gfc_conv_expr_descriptor.

    gcc/testsuite/
            PR fortran/125391
            * gfortran.dg/pr125391.f90: New test.

    (cherry picked from commit c9f26edda05b045d98c87d8c5dc0163f2cd0b652)


More information about the Gcc-bugs mailing list