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: [email protected]
Reporter: [email protected]
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);
}
--