[Issue 21581] New: -inline discards floating point precision of return values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 25 09:08:46 UTC 2021


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

          Issue ID: 21581
           Summary: -inline discards floating point precision of return
                    values
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

Related to issue 21376, the following test fails when compiled with `-inline`.

---
import core.math;

float hypot(float x, float y)
{
    float u = fabs(x);
    float v = fabs(y);
    return sqrt(u*u + v*v);
}

float abs(float re, float im)
{
    return hypot(re, im);
}

void log(real x)
{
    assert(x == 1);
}

extern(C) void main()
{
    float re = 0.866025403784438646787;
    float im = 0.5;
    return log(abs(re, im));
}
---

This only occurs with dmd (gdc and ldc do not have this issue).

--


More information about the Digitalmars-d-bugs mailing list