Bug 19788 – compiler crash on slicing a enum typed as vector

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-04-04T09:51:08Z
Last change time
2022-10-22T18:18:34Z
Keywords
ice, pull, SIMD
Assigned to
No Owner
Creator
Basile-z
See also
https://issues.dlang.org/show_bug.cgi?id=19630

Comments

Comment #0 by b2.temp — 2019-04-04T09:51:08Z
crasher: --- void main() { enum v = __vector(float[4]).init; const(float)[] a = v[]; } --- > dmd: dmd/backend/cod2.d:4261: Assertion `cast(int)(*e).Eoper == 147 || cast(int)(*e).Eoper == 146' failed. Does not happen if v storage is set to `const` instead of `enum`
Comment #1 by dlang-bot — 2020-12-21T08:55:53Z
@WalterBright created dlang/dmd pull request #12043 "fix Issue 19788 - compiler crash on slicing a enum typed as vector" fixing this issue: - fix Issue 19788 - compiler crash on slicing a enum typed as vector https://github.com/dlang/dmd/pull/12043
Comment #2 by dlang-bot — 2020-12-21T09:30:02Z
dlang/dmd pull request #12043 "fix Issue 19788 - compiler crash on slicing a enum typed as vector" was merged into master: - 8f475d87e726310c9491f6938f132cbc013f8297 by Walter Bright: fix Issue 19788 - compiler crash on slicing a enum typed as vector https://github.com/dlang/dmd/pull/12043
Comment #3 by bugzilla — 2022-10-20T08:28:29Z
This is now regarded as an error, as it is slicing an rvalue.
Comment #4 by bugzilla — 2022-10-20T08:31:32Z
Use .array property instead of slicing.
Comment #5 by dlang-bot — 2022-10-22T18:18:34Z
dlang/dmd pull request #14580 "cannot slice xmm rvalue" was merged into master: - 5a10d1eb723383881ce4f5df5129134028febde2 by Walter Bright: Fixes incorrect fix issue 19788 about slicing xmm value Fixes incorrect fix for https://issues.dlang.org/show_bug.cgi?id=19788 https://github.com/dlang/dmd/pull/14580