https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95104
--- Comment #1 from Bill Long <longb at cray dot com> --- The program appears to be legal and should execute and print 0. The last paragraph of 12.7.2 WAIT statement (current Fortran standard) is Execution of a WAIT statement specifying a unit that does not exist, has no file connected to it, or is not open for asynchronous input/output is permitted, provided that the WAIT statement has no ID= specifier; such a WAIT statement does not cause an error or end-of-file condition to occur.