https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71047
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- > Works for me on gfortran 5.3.x, 6.1 with patch, and 7.0 with patch. > > at the options to use. YMMV. [Book15] f90/bug% /opt/gcc/gcc7p-235998/bin/gfortran pr71047.f90 [Book15] f90/bug% ./a.out 0 [Book15] f90/bug% /opt/gcc/gcc7p-235999/bin/gfortran pr71047.f90 [Book15] f90/bug% ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x10868d5a9 #1 0x10868c985 #2 0x7fff9305f529 #3 0x108688b30 #4 0x108688cb8 #5 0x108688d56 Segmentation fault