[Bug c/79117] __builtin_isfinite edge case incorrect on i386

2017-01-18 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117 --- Comment #4 from Uroš Bizjak --- (In reply to Julian Taylor from comment #3) > using isinf is not correct as isinf(nan) == 0 > why does isinf do the truncation on x87 and isfinite does not? Because isinf is expanded in a target-dependent

[Bug c/79117] __builtin_isfinite edge case incorrect on i386

2017-01-18 Thread jtaylor.debian at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117 --- Comment #3 from Julian Taylor --- using isinf is not correct as isinf(nan) == 0 why does isinf do the truncation on x87 and isfinite does not?

[Bug c/79117] __builtin_isfinite edge case incorrect on i386

2017-01-17 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117 --- Comment #2 from joseph at codesourcery dot com --- If you use -fexcess-precision=standard, the classification built-in functions should convert values with excess range and precision to their semantic types as required by ISO C (see

[Bug c/79117] __builtin_isfinite edge case incorrect on i386

2017-01-17 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79117 --- Comment #1 from Uroš Bizjak --- 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