The following code (misuse of merge as a ternary operator) results in an ICE with ifort version 22.214.171.124 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.