This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83240] x86_64 vectorized sqrt of denormal yields -inf when DAZ=0
- From: "gson at gson dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 02 Dec 2017 10:37:06 +0000
- Subject: [Bug target/83240] x86_64 vectorized sqrt of denormal yields -inf when DAZ=0
- Auto-submitted: auto-generated
- References: <bug-83240-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83240
--- Comment #5 from Andreas Gustafsson <gson at gson dot org> ---
Re "may violate IEEE or ANSI standards", that argument could be used to justify
any behavior, even making 1 + 1 yield 42. Clearly the intent of
-funsafe-math-optimizations is not to allow arbitrary incorrect results, but
minor deviations from the standard such as differences in rounding or
evaluation order that result in reasonable approximations of the correct result
even if they differ from the exact result required by the standard.
When taking the square root of a very small positive number, a result of 0 is a
reasonable approximation of the correct result, even though it violates the
standard, but a result of minus infinity is not.