Bug 23218 – ICE: src/dmd/backend/cgxmm.d:1373: Assertion `0' failed.

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-06-29T10:40:24Z
Last change time
2023-01-14T10:18:42Z
Keywords
backend, ice, ice-on-valid-code, pull, SIMD
Assigned to
No Owner
Creator
Iain Buclaw
See also
https://issues.dlang.org/show_bug.cgi?id=23219, https://issues.dlang.org/show_bug.cgi?id=23220, https://issues.dlang.org/show_bug.cgi?id=23221

Comments

Comment #0 by ibuclaw — 2022-06-29T10:40:24Z
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); }
Comment #1 by dlang-bot — 2023-01-08T04:51:48Z
@WalterBright created dlang/dmd pull request #14790 "fix Issue 23218 - cgxmm.d:1373 assert fail" fixing this issue: - fix Issue 23218 - cgxmm.d:1373 assert fail https://github.com/dlang/dmd/pull/14790
Comment #2 by dlang-bot — 2023-01-13T20:22:41Z
dlang/dmd pull request #14790 "fix Issue 23218 - cgxmm.d:1373 assert fail" was merged into stable: - 084efd551b8dbe333445fa4c2f141d6d86e88b83 by Walter Bright: fix Issue 23218 - cgxmm.d:1373 assert fail https://github.com/dlang/dmd/pull/14790
Comment #3 by dlang-bot — 2023-01-14T10:18:42Z
dlang/dmd pull request #14813 "Merge Stable into master" was merged into master: - c1f39e04d2e35ef40302531d53eff97ea5760dab by Walter Bright: fix Issue 23218 - cgxmm.d:1373 assert fail (#14790) https://github.com/dlang/dmd/pull/14813