Bug 21672 – [REG][ICE][SIMD] accessing SIMD type as a short causes compiler ice
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2021-03-01T23:39:50Z
Last change time
2021-03-23T11:22:52Z
Keywords
backend, pull, SIMD
Assigned to
No Owner
Creator
ponce
Comments
Comment #0 by aliloko — 2021-03-01T23:39:50Z
# Repro case
This fails with DMD 2.096-b1 and -O in x86_64
------------- repro.d ------------------
import core.simd;
int4 _mm_loadu_si16(const(void)* mem_addr) pure @trusted
{
int r = *cast(short*)(mem_addr);
short8 result = [0, 0, 0, 0, 0, 0, 0, 0];
result.ptr[0] = cast(short)r;
return cast(int4)result;
}
----------------------------------------
Works in 2.095.1 though.
# Output
tym = 0x6
dmd failed with exit code -1073741795.
In Godbolt: https://d.godbolt.org/z/vx1j3r
> Would you have any chance to avoid modifying the "array" in between, from what I remember of the backend it was often only working when constructing simd values from literals.
Could you maybe also try to manipulate a static short[8] array and load that, no?
Sorry I don't understand what you mean. I'm not really looking for a workaround.
Comment #3 by dlang-bot — 2021-03-23T05:46:51Z
@WalterBright created dlang/dmd pull request #12297 "fix Issue 21672 - [REG][ICE][SIMD] accessing SIMD type as a short cau…" fixing this issue:
- fix Issue 21672 - [REG][ICE][SIMD] accessing SIMD type as a short causes compiler ice
https://github.com/dlang/dmd/pull/12297
Comment #4 by dlang-bot — 2021-03-23T11:22:52Z
dlang/dmd pull request #12297 "fix Issue 21672 - [REG][ICE][SIMD] accessing SIMD type as a short cau…" was merged into master:
- 1ab1d61186f2a17d2854b3b9e9fef28b0e4ae2eb by Walter Bright:
fix Issue 21672 - [REG][ICE][SIMD] accessing SIMD type as a short causes compiler ice
https://github.com/dlang/dmd/pull/12297