https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82480
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:ce6abe54ff1548b744ce7cd216d820e48a062c3d commit r16-1560-gce6abe54ff1548b744ce7cd216d820e48a062c3d Author: Harald Anlauf <anl...@gmx.de> Date: Tue Jun 17 21:09:32 2025 +0200 Fortran: various fixes for STAT/LSTAT/FSTAT intrinsics [PR82480] The GNU intrinsics STAT/LSTAT/FSTAT were inherited from g77, but changed the names of some keywords: FILE became NAME, and SARRAY became VALUES, which are the keywords documented in the gfortran manual. Adjust code and libgfortran error messages to reflect this change. Furthermore, add compile-time checking that INTENT(OUT) arguments are definable, and that array VALUES has at least size 13. Document that integer arguments are of default kind, and that overflows in conversion to integer return -1 in VALUES. PR fortran/82480 gcc/fortran/ChangeLog: * check.cc (gfc_check_fstat): Extend checks to INTENT(OUT) arguments. (gfc_check_fstat_sub): Likewise. (gfc_check_stat): Likewise. (gfc_check_stat_sub): Likewise. * intrinsic.texi: Adjust documentation. libgfortran/ChangeLog: * intrinsics/stat.c (stat_i4_sub_0): Fix argument names. Rename SARRAY to VALUES also in error message. When array VALUES is KIND=4, get only stat components that do not overflow INT32_MAX, otherwise set the corresponding VALUES elements to -1. (stat_i4_sub): Fix argument names. (lstat_i4_sub): Likewise. (stat_i8_sub_0): Likewise. (stat_i8_sub): Likewise. (lstat_i8_sub): Likewise. (stat_i4): Likewise. (stat_i8): Likewise. (lstat_i4): Likewise. (lstat_i8): Likewise. (fstat_i4_sub): Likewise. (fstat_i8_sub): Likewise. (fstat_i4): Likewise. (fstat_i8): Likewise. gcc/testsuite/ChangeLog: * gfortran.dg/stat_3.f90: New test.