https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114859
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code --- Comment #17 from anlauf at gcc dot gnu.org --- For reference: the commit is r15-46-gbca41a8d55e830 commit bca41a8d55e830c882b0f39246afead4fcfae6f7 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.