https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114859
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> --- And now cherry-picked to 14.1 as well: commit r14-10153-ge976bef1579086e6e83c6a47f6c5f8f996208f99 Author: Paul Thomas <pa...@gcc.gnu.org> Date: Mon Apr 29 11:52:11 2024 +0100 Fortran: Fix regression caused by r14-9752 [PR114959] 2024-04-29 Paul Thomas <pa...@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. (cherry picked from commit bca41a8d55e830c882b0f39246afead4fcfae6f7)