https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113679

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah, it is, that is how excess precision behaves.
Due to the cast applying just to l rather than l - d it returns 0.0 with
-fexcess-precision=standard, but if you change it to (double)(l - d) then it
will return -2.0
at all optimization levels with -fexcess-precision=standard. 
-fexcess-precision=fast
behaves depending on what instructions are actually used and where the
conversions to float or double happen due to storing of expressions or
subexpressions into memory as documented.
If you don't like excess precision and have SSE2, you can use -msse2
-mfpmath=sse.

Reply via email to