[Issue 15204] New: wrong code with -m32 -O -release (floating points, x86)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 14 17:10:38 PDT 2015


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

          Issue ID: 15204
           Summary: wrong code with -m32 -O -release (floating points,
                    x86)
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ilyayaroshenko at gmail.com

See debug code in https://github.com/D-Programming-Language/phobos/pull/3559 :

====
writeln("ttt ", [i, a, b, m, (a + b) / 2, (a + b) / 2.0, ], a <= m, m <= b);
====

produce text:
===
ttt [8, -5.50533e+307, 4.49423e+307, -8.08875e+307, -8.08875e+307,
-8.08875e+307]truetrue
===

So, (-5.50533e+307 + 4.49423e+307) / 2.0 = -8.08875e+307, but it is wrong.

32 code on FreeBSD/Linux fails, but on OSX works fine.

--


More information about the Digitalmars-d-bugs mailing list