Your code is invalid Fortran, so a Fortran processor can do anything it wants. This includes doing what you expect or deleting your filesystems.
Fortran 2023, page 163
10.1.5.2.4 Evaluation of numeric intrinsic operations
The execution of any numeric operation whose result is not defined by the arithmetic used by the processor is prohibited.
The prohibition is not a number constraint. A Fortran processor need not catch or issue an error or warning. The prohibition is on the programmer.