digitalmars.D.bugs - [Issue 23218] New: ICE: src/dmd/backend/cgxmm.d:1373: Assertion `0'
- d-bugmail puremagic.com (33/33) Jun 29 2022 https://issues.dlang.org/show_bug.cgi?id=23218
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 puremagic.com Reporter: ibuclaw 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); } --
Jun 29 2022