The following code (misuse of merge as a ternary operator) results in an ICE with ifort version 184.108.40.206 unless compiled with -O0
character(len=*), parameter :: str = 'abcde'
print*, index(str,merge('a','d',str(4:4) == 'd'))
end program test
For more complete information about compiler optimizations, see our Optimization Notice.