[Bug fortran/121204] Explicit interfaces in module are incorrectly passed to submodule
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 4 14:03:36 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121204
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:
https://gcc.gnu.org/g:053bde6ca9b490c6426740f8e3168054c4a43463
commit r17-1343-g053bde6ca9b490c6426740f8e3168054c4a43463
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Thu Jun 4 11:55:50 2026 +0100
Fortran: fix always_explicit not copied by gfc_copy_attr [PR121204]
gfc_copy_attr omitted the always_explicit attribute, so when
gfc_copy_dummy_sym created a fresh copy of a dummy procedure symbol in
a submodule module procedure (gfc_match_submod_proc), the flag was
silently lost. At translation time nodesc_arg was set true for calls
through that dummy procedure, causing array constructors to be passed
as raw data pointers instead of array descriptors. Callers with
assumed-shape dummy arguments then read garbage bounds.
2026-06-04 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/121204
* symbol.cc (gfc_copy_attr): Copy the always_explicit attribute.
gcc/testsuite
PR fortran/121204
* gfortran.dg/submodule_38.f90: New test.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
More information about the Gcc-bugs
mailing list