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

--- Comment #1 from Ketmar Dark <ket...@ketmar.no-ip.org> ---
some clarification: basically, this boils down to codegen bug: if we have
function that returns some floating point value, and FPU is involved, and
caller does `cast(void)myfunc()`, result is not popped from FPU stack.

note that `cast(void)` is vital here: everything is ok without it. also, as
X86_64 doesn't use FPU for floats and doubled, you need to use `real` there to
trigger the bug.

minified sample by ag0aep6g:

double f() { return 1; }
void main()
{
    cast(void) f();
    cast(void) f();
    cast(void) f();
    cast(void) f();
    cast(void) f();
    cast(void) f();
    cast(void) f();

    double b = 2;
    assert(b == 2); /* fails; should pass */
}

--

Reply via email to