https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64097
--- Comment #2 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Dominique d'Humieres from comment #1) > WORKSFORME on x86_64-apple-darwin14 with 4.8 up to trunk (6.0) and the > various options I tried: > > [Book15] f90/bug% gfortran pr64097.f90 -fcheck=all -fsanitize=address > [Book15] f90/bug% a.out > 0 > 58 > > gfortran is 5.2. I think the trapping of exceptions must be enabled. % gfortran --version GNU Fortran (GCC) 5.1.0 % gfortran -O -march=native -g -ffpe-trap=zero,overflow,invalid nested-where.f90 && ./a.out 0 Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation. Backtrace for this error: #0 0x7F09C1E59B97 #1 0x7F09C1E58D90 #2 0x7F09C1430F4F #3 0x7F09C1BE7277 #4 0x7F09C1BEBE50 #5 0x400A34 in MAIN__ at nested-where.f90:0 Floating exception Without -ffpe-trap=... I get the same as you.