https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486
--- Comment #10 from Susi Lehtola <jussilehtola at fedoraproject dot org> ---
Compiled with -g, rerun gives
$ ./a.out
Fortran runtime error: Zero-length string passed as value to
get_environment_variable.
Error termination. Backtrace:
#0 0x401267 in zerolen_value
at /tmp/readvar2.f90:17
#1 0x4012c4 in main
at /tmp/readvar2.f90:22
This is the second call.
The problem originates in
https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=libgfortran/intrinsics/env.c;hb=HEAD
where the size checks are in an incorrect order.