Bug 23084 – [REG 2.080] dmd: src/dmd/backend/cgxmm.d:816: Assertion `0' failed.

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-05-03T19:10:06Z
Last change time
2022-05-06T03:26:25Z
Keywords
backend, pull
Assigned to
No Owner
Creator
Iain Buclaw
See also
https://issues.dlang.org/show_bug.cgi?id=23077, https://issues.dlang.org/show_bug.cgi?id=23085

Comments

Comment #0 by ibuclaw — 2022-05-03T19:10:06Z
Introduced by https://github.com/dlang/dmd/pull/7994 --- short saturateSignedIntToSignedShort(int value) { return cast(short) value; } __vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) { __vector(short[8]) r; r= saturateSignedIntToSignedShort(a.array[0]); return cast(__vector(int[4]))r; }
Comment #1 by ibuclaw — 2022-05-03T20:00:33Z
Reverting PR7994, and the ICE moves to a different location, which points at another regression in v2.087.0 introduced by https://github.com/dlang/dmd/pull/9608
Comment #2 by ibuclaw — 2022-05-03T20:28:42Z
Reverting both PR7994 and PR9608 and there is still an ICE in stable. Yet another regressing commit in v2.096.0 introduced by https://github.com/dlang/dmd/pull/12048
Comment #3 by ibuclaw — 2022-05-03T20:51:08Z
Reverting PR7994, PR9608, and PR12048 and there is still an ICE in stable. Yet another regressing commit in v2.097.0 introduced by https://github.com/dlang/dmd/pull/12409
Comment #4 by ibuclaw — 2022-05-03T21:23:05Z
Reverting PR7994, PR9608, PR12048, and PR12409, and the ICE goes away in both upstream stable (081d61e15) and master (7b07f9164) branches. Combining different combinations of reverting the above PRs against the reduced test results in the ICE. --- tym = 0x6 dmd: src/dmd/backend/cgxmm.d:816: Assertion `0' failed. Aborted (core dumped) --- Reverting PR7994, PR9608, and PR12409 only results in the ICE: --- tym = x6 dmd: src/dmd/backend/cgxmm.d:765: Assertion `0' failed. Aborted (core dumped) ---
Comment #5 by ibuclaw — 2022-05-03T21:32:19Z
*** Issue 23077 has been marked as a duplicate of this issue. ***
Comment #6 by ibuclaw — 2022-05-03T21:33:59Z
Test case from issue23077 that doesn't use SIMD. --- float bug(float x) { short i = *cast(short*)&x; ++i; return *cast(float*)&i; }
Comment #7 by ibuclaw — 2022-05-03T21:37:31Z
Original test simplified: --- __vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) { __vector(short[8]) r = cast(short)(a.array[0]); return cast(__vector(int[4]))r; }
Comment #8 by ibuclaw — 2022-05-04T08:44:23Z
Similar, but using byte vector. Only triggers in debug builds. --- __vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) { __vector(byte[16]) r = cast(byte)(a.array[0]); return cast(__vector(int[4]))r; }
Comment #9 by dlang-bot — 2022-05-04T16:25:17Z
@ljmf00 updated dlang/dmd pull request #14058 "fix(backend): define XMM load/store codegen for short type variants" fixing this issue: - fix(backend): define XMM load/store codegen for short type variants The codegen try to generate optimized calls with XMM opcodes but fail to do it. This patch adds logic to generate XMM load/store opcodes for TYshort,TYushort. It also adds tests for previous similar ICEs. Fix issue 23077, 23084. Reference: https://issues.dlang.org/show_bug.cgi?id=23077 Reference: https://issues.dlang.org/show_bug.cgi?id=23084 Reference: https://github.com/AuburnSounds/intel-intrinsics/commit/047e9f01ae4092600f99abab1a34e32db26b3a4f Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/14058
Comment #10 by bugzilla — 2022-05-06T03:26:25Z
*** This issue has been marked as a duplicate of issue 23077 ***