Don <> changed:

           What    |Removed                     |Added
            Summary|feqrel fails assert in      |[64 bit] wrong code for
                   |std.math on x86_64 systems  |*p==0, when widening
                   |                            |conversion occurs
           Severity|normal                      |blocker

--- Comment #5 from Don <> 2012-05-08 22:08:29 PDT ---
Original title: feqrel fails assert in std.math on x86_64 systems

Reduced test case shows it is a backend bug.
The common subexpression *px gets extended to int when calculating b. Inside
the assert it is treated as *cast(int *)px, so that it picks up x[1] instead of
just x[0]. It seems to only apply to comparisons with 0.
Subtle and disastrous, raising severity to blocker.

void main()
    ushort[2] x = void;
    x[0] = 0;
    x[1] = 0x1234;

    ushort *px =  &x[0];

    uint b = px[0];  // this causes the next line to fail

    assert(px[0] == 0);

It generates
   cmp    dword ptr -010h[RBP],0
should be word ptr, which doesn't exist in 64bit.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to