[Issue 14452] [REG2.067] Floating point invalid operation when returning a structure containing a float field

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 26 19:27:15 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14452

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|---                         |WONTFIX

--- Comment #9 from Walter Bright <bugzilla at digitalmars.com> ---
Whether the exception happens or not depends on whether the compiler uses XMM
operations or X87 operations. The programming world has largely abandoned the
X87, and the notion of throwing exceptions based on NaNs.

I suggest abandoning such code as well, it is always going to be subject to the
vagaries of code generations. We also had to give on supporting signaling NaNs
for similar reasons.

Another problematic issue is floating point constant folding - exceptions
aren't thrown at compile time, so depending on optimization settings the
runtime exception can come and go in rather arbitrary ways.

And lastly, the X87 control word tends to wreak havoc with pure functions
because it is a global setting.

However, NaN tracking is consistent and works well. I recommend changing your
code to simply test for NaN in the final result.

I'm marking this as "won't fix". I have no idea how to fix it in a consistent
manner, I suspect it is not possible.

--


More information about the Digitalmars-d-bugs mailing list