D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21486 - assert fail cgcod.d:1864 with simd and -O
Summary: assert fail cgcod.d:1864 with simd and -O
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: backend, pull, SIMD
Depends on:
Blocks:
 
Reported: 2020-12-18 09:28 UTC by Walter Bright
Modified: 2020-12-21 09:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2020-12-18 09:28:45 UTC

    
Comment 1 Walter Bright 2020-12-18 09:30:07 UTC
Compile with -O:

-------------------
import core.simd;

void test7951_2()
{
    float[4] v1 = [1,2,3,4];
    float[4] v2 = [1,2,3,4];
    float4 f1, f2, f3;
    f1.array = v1;
    f2.array = v2;
    f3 = f1 + f2;
    assert((cast(float[4])f3)[2] == 6);
}
Comment 2 Walter Bright 2020-12-20 02:32:12 UTC
Fix: https://github.com/dlang/dmd/pull/12035
Comment 3 Walter Bright 2020-12-21 09:36:25 UTC
The PR was merged.