https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117
--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> --- You can use __builtin_isinf here, so: if (__builtin_isinf(c)) { puts("finite"); } else { puts("not finite"); } The expansion of __builtin_isinf performs value truncation automatically when x87 is involved. Alternatively, you should use --ffloat-store, or -msse2 -mfpmath=sse.