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);
}