[Issue 23218] New: ICE: src/dmd/backend/cgxmm.d:1373: Assertion `0' failed.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 29 10:40:24 UTC 2022


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

          Issue ID: 23218
           Summary: ICE: src/dmd/backend/cgxmm.d:1373: Assertion `0'
                    failed.
           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

The problem is that the cast ends up being represented as a VectorExp
constructed from a static (or dynamic) array, but dmd only handles the array
literal case, so treats the `a` parameter as a single element.

What it should instead do is a view conversion from static array to vector.
---
auto convtest(int[4] a)
{
    return cast(__vector(int[4]))a;
}

void main()
{
    // prints 1
    pragma(msg, convtest([1,2,3,4])[0]);
    // Passes CTFE -> OK
    static assert(convtest([1,2,3,4])[0] == 1);
    // src/dmd/backend/cgxmm.d:1373: Assertion `0' failed.
    assert(convtest([1,2,3,4])[0] == 1);
}

--


More information about the Digitalmars-d-bugs mailing list