https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121627
--- Comment #5 from Dustin Warkotsch <dustin-warkotsch at web dot de> --- (In reply to kargls from comment #2) > (In reply to kargls from comment #1) > > This leads to the same ICE without the overhead of a Fortran IO statement. > > > > program real_kinds > > use iso_fortran_env > > i = real64 > > end program real_kinds > > Well, the coffee kicked in. The program name 'real_kinds' is > a global identifier, which just so happens to be the name > of a named constant in iso_fortran_env. Changing the code > to > > program real_kinds > use iso_fortran_env, only : real64 > i = real64 > end program real_kinds > > allows it to compile, or changing it to > > program real_kinds > use iso_fortran_env, only : reals => real_kinds > i = real64 > end program real_kinds Huh, I didn't notice that. I just took the name from the example program in the "selected_real_kind" GCC doc ( https://gcc.gnu.org/onlinedocs/gfortran/SELECTED_005fREAL_005fKIND.html ) and built upon that. I can confirm that changing the program name to something sensible also solves the problem. Thank you for your patch.