gcc/libgfortran/intrinsics
Harald Anlauf ce6abe54ff 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.
2025-06-18 18:52:57 +02:00
..
abort.c Update copyright years. 2025-01-02 11:59:57 +01:00
access.c Update copyright years. 2025-01-02 11:59:57 +01:00
args.c Update copyright years. 2025-01-02 11:59:57 +01:00
associated.c Update copyright years. 2025-01-02 11:59:57 +01:00
c99_functions.c Update copyright years. 2025-01-02 11:59:57 +01:00
chdir.c Update copyright years. 2025-01-02 11:59:57 +01:00
chmod.c Update copyright years. 2025-01-02 11:59:57 +01:00
clock.c Update copyright years. 2025-01-02 11:59:57 +01:00
cpu_time.c Update copyright years. 2025-01-02 11:59:57 +01:00
cshift0.c Update copyright years. 2025-01-02 11:59:57 +01:00
ctime.c Update copyright years. 2025-01-02 11:59:57 +01:00
date_and_time.c Update copyright years. 2025-01-02 11:59:57 +01:00
dprod_r8.f90 Update copyright years. 2025-01-02 11:59:57 +01:00
dtime.c Update copyright years. 2025-01-02 11:59:57 +01:00
env.c Update copyright years. 2025-01-02 11:59:57 +01:00
eoshift0.c Update copyright years. 2025-01-02 11:59:57 +01:00
eoshift2.c Update copyright years. 2025-01-02 11:59:57 +01:00
erfc_scaled.c Update copyright years. 2025-01-02 11:59:57 +01:00
erfc_scaled_inc.c Update copyright years. 2025-01-02 11:59:57 +01:00
etime.c Update copyright years. 2025-01-02 11:59:57 +01:00
execute_command_line.c Update copyright years. 2025-01-02 11:59:57 +01:00
exit.c Update copyright years. 2025-01-02 11:59:57 +01:00
extends_type_of.c Update copyright years. 2025-01-02 11:59:57 +01:00
f2c_specifics.F90 Update copyright years. 2025-01-02 11:59:57 +01:00
fnum.c Update copyright years. 2025-01-02 11:59:57 +01:00
gerror.c Update copyright years. 2025-01-02 11:59:57 +01:00
getcwd.c Update copyright years. 2025-01-02 11:59:57 +01:00
getlog.c Update copyright years. 2025-01-02 11:59:57 +01:00
getXid.c Update copyright years. 2025-01-02 11:59:57 +01:00
hostnm.c Update copyright years. 2025-01-02 11:59:57 +01:00
ierrno.c Update copyright years. 2025-01-02 11:59:57 +01:00
is_contiguous.c Update copyright years. 2025-01-02 11:59:57 +01:00
ishftc.c Update copyright years. 2025-01-02 11:59:57 +01:00
kill.c Update copyright years. 2025-01-02 11:59:57 +01:00
link.c Update copyright years. 2025-01-02 11:59:57 +01:00
move_alloc.c Update copyright years. 2025-01-02 11:59:57 +01:00
mvbits.c Update copyright years. 2025-01-02 11:59:57 +01:00
pack_generic.c Update copyright years. 2025-01-02 11:59:57 +01:00
perror.c Update copyright years. 2025-01-02 11:59:57 +01:00
rand.c Update copyright years. 2025-01-02 11:59:57 +01:00
random.c libfortran: Add 5 missing UNSIGNED symbols [PR120153] 2025-05-07 18:47:50 +02:00
random_init.f90 Update copyright years. 2025-01-02 11:59:57 +01:00
reduce.c Fortran: Fix some problems with the reduce intrinsic [PR119460] 2025-04-09 09:50:04 +01:00
rename.c Update copyright years. 2025-01-02 11:59:57 +01:00
reshape_generic.c Update copyright years. 2025-01-02 11:59:57 +01:00
reshape_packed.c Update copyright years. 2025-01-02 11:59:57 +01:00
selected_char_kind.c Update copyright years. 2025-01-02 11:59:57 +01:00
selected_int_kind.f90 Update copyright years. 2025-01-02 11:59:57 +01:00
selected_real_kind.f90 Update copyright years. 2025-01-02 11:59:57 +01:00
signal.c Update copyright years. 2025-01-02 11:59:57 +01:00
size.c Update copyright years. 2025-01-02 11:59:57 +01:00
sleep.c Update copyright years. 2025-01-02 11:59:57 +01:00
spread_generic.c Update copyright years. 2025-01-02 11:59:57 +01:00
stat.c Fortran: various fixes for STAT/LSTAT/FSTAT intrinsics [PR82480] 2025-06-18 18:52:57 +02:00
string_intrinsics.c Update copyright years. 2025-01-02 11:59:57 +01:00
string_intrinsics_inc.c Update copyright years. 2025-01-02 11:59:57 +01:00
symlnk.c Update copyright years. 2025-01-02 11:59:57 +01:00
system.c Update copyright years. 2025-01-02 11:59:57 +01:00
system_clock.c Update copyright years. 2025-01-02 11:59:57 +01:00
time.c Update copyright years. 2025-01-02 11:59:57 +01:00
time_1.h Update copyright years. 2025-01-02 11:59:57 +01:00
trigd.c Update copyright years. 2025-01-02 11:59:57 +01:00
trigd.inc Update copyright years. 2025-01-02 11:59:57 +01:00
trigd_lib.inc Update copyright years. 2025-01-02 11:59:57 +01:00
umask.c Update copyright years. 2025-01-02 11:59:57 +01:00
unlink.c Update copyright years. 2025-01-02 11:59:57 +01:00
unpack_generic.c Update copyright years. 2025-01-02 11:59:57 +01:00