https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100591
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-05-14 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- $ gcc pr100591.c -fsanitize=undefined -fsanitize=float-cast-overflow && ./a.out pr100591.c:8:3: runtime error: nan is outside the range of representable values of type 'int' -2147483648 -fsanitize=float-cast-overflow ... Unlike other similar options, -fsanitize=float-cast-overflow is not enabled by -fsanitize=undefined. This option does not work well with "FE_INVALID" exceptions enabled. @Jakub: Do you know why is it disabled by default? Note that clang enables it with -fsanitize=undefined: $ clang pr100591.c -fsanitize=undefined && ./a.out pr100591.c:8:19: runtime error: nan is outside the range of representable values of type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior pr100591.c:8:19 in -2147483648