https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113005
--- Comment #13 from Lipeng Zhu <lipeng.zhu at intel dot com> --- OK, I think I find the root cause of this error, when thread number greater than 1000, the file_name = 1000_tst.dat, character(11) will overflow. This will generate the same file_name like ***_tst.dat. diff --git a/libgomp/testsuite/libgomp.fortran/rwlock_1.f90 b/libgomp/testsuite/libgomp.fortran/rwlock_1.f90 index f90ecbeb00f..1c271ae031d 100644 --- a/libgomp/testsuite/libgomp.fortran/rwlock_1.f90 +++ b/libgomp/testsuite/libgomp.fortran/rwlock_1.f90 @@ -7,13 +7,12 @@ program main use omp_lib implicit none integer:: unit_number, v1, v2, i - character(11) :: file_name + character(16) :: file_name character(3) :: async = "no" !$omp parallel private (unit_number, v1, v2, file_name, async, i) do i = 0, 100 unit_number = 10 + omp_get_thread_num () - write (file_name, "(I3, A)") unit_number, "_tst.dat" - file_name = adjustl(file_name) + write (file_name, "(I5.5, A)") unit_number, "_tst.dat" open (unit_number, file=file_name, asynchronous="yes") ! call inquire with file parameter to test find_file in unix.c inquire (file=file_name, asynchronous=async)