https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86831
--- Comment #5 from janus at gcc dot gnu.org --- (In reply to Richard Biener from comment #4) > "nan_inf_fmt" suggests that the 'fast' part in -Ofast might be the issue. > So try -O3 -march=native instead? All three tests pass with those flags. As just mentioned, 'intrinsic_nearest' and 'nan_inf_fmt' fail with -Ofast alone (and with basically all recent gfortran versions, at least 5 to trunk). I'm not so much worried about these. However, in-pack.f90 is the only one that is made to fail by the combination of -Ofast and -march=skylake-avx512. I think it's the same problem as PR 86735 (at least it behaves in the same way). Here is a reduction that shows the failure: program main implicit none complex(kind=8) :: a8(5),b8(5) integer :: i a8 = (/(cmplx(i,-i,kind=8),i=1,5)/) b8 = (/(2*cmplx(i,-i,kind=8),i=1,5)/) call csub8(a8(5:1:-1),b8(5:1:-1),5) end program main subroutine csub8(a,b,n) implicit none complex(kind=8), dimension(n) :: a,b complex(kind=8), dimension(n) :: aa, bb integer :: n, i aa = (/(cmplx(n-i+1,i-n-1,kind=8),i=1,n)/) if (any(aa /= a)) STOP 9 bb = (/(2*cmplx(n-i+1,i-n-1,kind=8),i=1,5)/) if (any(bb /= b)) STOP 10 end subroutine csub8