The master branch has been updated by Jerry DeLisle <[email protected]>:
https://gcc.gnu.org/g:322362ce514228d5f9fcd3a06444b01425d665e6 commit r17-3679-g322362ce514228d5f9fcd3a06444b01425d665e6 On 8/25/26 6:38 PM, Jerry DeLisle wrote:
This wrong code bug is fixed by the attached patch. I plan commit as simple and obvious. It's not even a oneliner Regression tested on X86_64. Regards, Jerry --- fortran: [PR82065] ISO_FORTRAN_ENV array constants used in a procedure Array-valued named constants from ISO_FORTRAN_ENV are forced TREE_STATIC so they can be inlined, but the static initializer was only emitted when the symbol's namespace belonged to the main program or a module. Used inside any procedure the array was emitted uninitialized, yielding zeros. Assisted-by: Claude Opus 5 PR fortran/82065 gcc/fortran/ChangeLog: * trans-decl.cc (gfc_get_symbol_decl): Emit the static initializer for intrinsic array parameters regardless of the enclosing namespace. gcc/testsuite/ChangeLog: * gfortran.dg/iso_fortran_env_10.f90: New test.
