https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96486
--- Comment #11 from kargl at gcc dot gnu.org --- (In reply to Susi Lehtola from comment #10) > 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. Sorry, I don't understand what you mean by incorrect order. Can you please run a.out under gdb and post the backtrace % gdb ./a.out (gdb) run