D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19748 - [REG][wrong codegen] Returning 4 floats + DMD + 64-bit
Summary: [REG][wrong codegen] Returning 4 floats + DMD + 64-bit
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 regression
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2019-03-17 15:13 UTC by ponce
Modified: 2019-06-16 20:34 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ponce 2019-03-17 15:13:52 UTC
Consider this file:

------------------------ repro.d -------------------------

struct A
{
    float[4] array = [1, 2, 3, 4];
}

A _mm_add_ss(A a, A b) pure @safe
{
    a.array[0] += b.array[0];
    return a;
}

void main()
{
    A a;
    a = _mm_add_ss(a, a);

    // this assert fails, content is [1, 2, 3, 4] instead
    // This is a 2.085.0 regression
    assert(a.array == [2.0f, 2, 3, 4]); 
}

-----------------------------------------------------------


Build with DMD 2.085.0 on Windows:

$ dmd repro.d -O -inline -noboundscheck -m64 -inline -release -unittest
$ repro.exe

The assert fails, but it works in DMD 2.084.1
Comment 1 Rainer Schuetze 2019-06-16 20:34:33 UTC
Seems fixed in dmd 2.086.0. Please reopen if it still occurs.