]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix regression caused by r14-9752 [PR114959]
authorPaul Thomas <pault@gcc.gnu.org>
Mon, 29 Apr 2024 10:52:11 +0000 (11:52 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Mon, 29 Apr 2024 10:52:11 +0000 (11:52 +0100)
commitbca41a8d55e830c882b0f39246afead4fcfae6f7
tree913b30b448eabf17f6c75dcadadbd5fa9c561369
parentadd51a2514a39978dc66976a8974f8435c86168f
Fortran: Fix regression caused by r14-9752 [PR114959]

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

gcc/fortran
PR fortran/114959
* trans-expr.cc (gfc_trans_class_init_assign): Return NULL_TREE
if the default initializer has all NULL fields. Guard this
by a requirement that the code not be EXEC_INIT_ASSIGN and that
the object be an INTENT_OUT dummy.
* trans-stmt.cc (gfc_trans_allocate): Change the initializer
code for allocate with mold to EXEC_ALLOCATE to allow an
initializer with all NULL fields.

gcc/testsuite/
PR fortran/114959
* gfortran.dg/pr114959.f90: New test.
gcc/fortran/trans-expr.cc
gcc/fortran/trans-stmt.cc
gcc/testsuite/gfortran.dg/pr114959.f90 [new file with mode: 0644]