[Issue 16038] New: -O Codegen bug: Missing floating-point negation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 17 19:17:32 PDT 2016


          Issue ID: 16038
           Summary: -O Codegen bug: Missing floating-point negation
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: thomas.bockman at gmail.com

This works fine without optimizations, or with optimizations on GDC and LDC.

Both 32- and 64-bit are effected.
module app;

F foo(F)(F x)
    F ret = 1;
    ret = -ret;
    return ret;

void main() {
    import std.stdio;
    writeln(foo(-168.1234L));  // DMD: -1
    writeln(foo(-168.1234));   // DMD:  1
    writeln(foo(-168.1234f));  // DMD:  1.00002


More information about the Digitalmars-d-bugs mailing list