https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121472
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:5bb465a789600a46f3b53b236ba07b30cea6cbac commit r16-6321-g5bb465a789600a46f3b53b236ba07b30cea6cbac Author: Jerry DeLisle <[email protected]> Date: Sun Dec 21 13:33:15 2025 -0800 fortran: [PR121472] Fix ICE with constructor for finalized zero-size type. When a derived type has a final subroutine and a constructor interface, but is effectively zero-sized, the gimplifier fails on the finalization code. The existing check for empty types (!derived->components) only catches completely empty types, not types with empty components. Replace with a tree-level TYPE_SIZE_UNIT check that catches all zero-size cases. PR fortran/121472 gcc/fortran/ChangeLog: * trans.cc (gfc_finalize_tree_expr): Replace !derived->components check with TYPE_SIZE_UNIT check for zero-size types. gcc/testsuite/ChangeLog: * gfortran.dg/pr121472.f90: New test.
