]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix a gimplifier ICE/wrong result with finalization [PR36337]
authorPaul Thomas <pault@gcc.gnu.org>
Fri, 29 Mar 2024 07:23:19 +0000 (07:23 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Fri, 29 Mar 2024 07:23:19 +0000 (07:23 +0000)
commit3c793f0361bc66d2a6bf0b3e1fb3234fc511e2a6
treec3cf7adcce68069bee7d27a43b7a49783282c5be
parent22f48d78f033922fd2fbf9252041cd97ce201052
Fortran: Fix a gimplifier ICE/wrong result with finalization [PR36337]

2024-03-29  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/36337
PR fortran/110987
PR fortran/113885
* trans-expr.cc (gfc_trans_assignment_1): Place finalization
block before rhs post block for elemental rhs.
* trans.cc (gfc_finalize_tree_expr): Check directly if a type
has no components, rather than the zero components attribute.
Treat elemental zero component expressions in the same way as
scalars.

gcc/testsuite/
PR fortran/113885
* gfortran.dg/finalize_54.f90: New test.
* gfortran.dg/finalize_55.f90: New test.

gcc/testsuite/
PR fortran/110987
* gfortran.dg/finalize_56.f90: New test.
gcc/fortran/trans-expr.cc
gcc/fortran/trans.cc
gcc/testsuite/gfortran.dg/finalize_54.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_55.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_56.f90 [new file with mode: 0644]