Bug 21328 – Forwarding static float array element inside a lambda crashes dmd backend
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-10-19T14:00:03Z
Last change time
2020-11-15T22:23:32Z
Keywords
backend, ice-on-valid-code, pull
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0 by dkorpel — 2020-10-19T14:00:03Z
When upgrading to dmd 2.094 I found that this (reduced) code crashes dmd:
```
void bar(float x) {}
void foo(float[1] arr) {
() {
bar(arr[0]);
} ();
}
```
It prints:
tym = 0x227
[1] 14828 illegal hardware instruction dmd -c tymbug.d
Suggesting a regression in dmd's backend.
Possibly caused by: https://github.com/dlang/dmd/pull/11693
I have not verified this yet however.
Comment #1 by dkorpel — 2020-10-22T10:04:06Z
Further reduced to:
```
void foo(float[1] arr) {
() {
float x = arr[0];
} ();
}
```
The assert on src/dmd/backend/cgxmm.d:804 fails because `xmmstore` is called with tym_t = TYarray | mTYvolatile, and there is no case for TYarray in the `switch (tybasic(tym))`.
I've bisected it with Digger, it's introduced in:
https://github.com/dlang/dmd/pull/10200
Comment #2 by dlang-bot — 2020-11-06T06:06:13Z
@thewilsonator created dlang/dmd pull request #11927 "Fix issue 21328: Forwarding static float array element inside a lambda crashes dmd backend" fixing this issue:
- Fix issue 21328: Forwarding static float array element inside a lambda crashes dmd backend
https://github.com/dlang/dmd/pull/11927
Comment #3 by dlang-bot — 2020-11-15T22:23:32Z
dlang/dmd pull request #11927 "Fix issue 21328: Forwarding static float array element inside a lambda crashes dmd backend" was merged into master:
- 193c28f462911018dd0fd5be388486fcaee38010 by Nicholas Lindsay Wilson:
Fix issue 21328: Forwarding static float array element inside a lambda crashes dmd backend
https://github.com/dlang/dmd/pull/11927