TypeVector::dotExp is the culprit, the front-end is type punning a VectorExp as a normal array.
Correct codegen would just make a copy of the underlying array literal.
Comment #2 by ibuclaw — 2019-01-28T23:38:06Z
It is at this point I realise this is a duplicate.
*** This issue has been marked as a duplicate of issue 19223 ***
Comment #3 by ibuclaw — 2019-01-28T23:41:34Z
Actually, I'll make this variant, which also ICE's.
int f (const int[4] x)
{
int sum = 0;
foreach (i; x) sum += i;
return sum;
}
void main ()
{
import core.simd : int4;
f(int4(2).array);
}
Comment #4 by dlang-bot — 2019-03-10T13:32:17Z
@ibuclaw created dlang/dmd pull request #9438 "[dmd-cxx] Backport vector array fixes from master" fixing this issue:
- fix Issue 19607 - [ICE] dmd/e2ir.d(117): Invalid type mTYconst|TYstruct
https://github.com/dlang/dmd/pull/9438
Comment #5 by dlang-bot — 2019-03-12T19:52:28Z
dlang/dmd pull request #9438 "[dmd-cxx] Backport vector array fixes from master" was merged into dmd-cxx:
- 4b95edb5fa40b3dadee1b9a58a0a6ff97f2e3463 by Iain Buclaw:
fix Issue 19607 - [ICE] dmd/e2ir.d(117): Invalid type mTYconst|TYstruct
https://github.com/dlang/dmd/pull/9438