Bug 17215 – [Reg 2.073] ICE(cgcod.c:findreg) with SIMD and -O -inline

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-02-21T02:14:00Z
Last change time
2017-08-07T13:15:18Z
Keywords
ice, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2017-02-21T02:14:57Z
cat > bug.d << CODE alias vec = __vector(int[4]); vec op(vec a) { return a; } vec binop(vec a) { return op(a); } CODE dmd -c -O -inline bug ---- Internal error: backend/cgcod.c 1659 [¹] ---- Ends up calling findreg with an empty register mask. Seems like sth. in loaddata or so doesn't properly handle xmm registers. Callstack: ---- 0 in findreg of backend/cgcod.c:1659 1 in fixresult of backend/cod1.c:1802 2 in loaddata of backend/cod1.c:4769 3 in codelem of backend/cgcod.c:2669 4 in scodelem of backend/cgcod.c:2740 5 in cdeq of backend/cod4.c:646 6 in codelem of backend/cgcod.c:2619 7 in cdcomma of backend/cod2.c:2195 8 in codelem of backend/cgcod.c:2619 9 in cdcomma of backend/cod2.c:2194 10 in codelem of backend/cgcod.c:2619 ---- [¹]: https://github.com/dlang/dmd/blob/65f2dfdddae822cf6bb483e82eac32839e142a72/src/backend/cgcod.c#L1659
Comment #1 by bugzilla — 2017-02-22T04:31:52Z
This is working for me on Windows 64. It's listed as "All" platforms. Which is it failing on?
Comment #2 by code — 2017-02-24T11:54:26Z
Ah yes calling convention, it's definitely failing on linux x86_64. https://dpaste.dzfl.pl/449dd3669728
Comment #3 by code — 2017-02-24T16:55:26Z
cat > bug.d << CODE alias vec = __vector(int[4]); vec binop(vec a) { vec b = a; return b; } CODE dmd -c -O bug ---- Internal error: backend/cgcod.c 1659 ---- Further reduced, no longer requires -inline.
Comment #4 by code — 2017-02-24T18:21:12Z
Digger points to https://github.com/dlang/dmd/pull/6176 for having introduced this.
Comment #5 by code — 2017-02-24T19:27:01Z
Comment #6 by github-bugzilla — 2017-02-25T01:55:41Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/46d1948f4c4f05143729f9849b4edefe01b1a02e fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O -inline - caused by assigning 2*REGSIZE XMM vectors partially - only triggers since SROA sees this 8 bytes access https://github.com/dlang/dmd/commit/b054a20d288db623c91ccbb9f2fb1e9f64e5f100 Merge pull request #6566 from MartinNowak/fix17215 fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O -inline
Comment #7 by github-bugzilla — 2017-02-25T18:52:30Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/46d1948f4c4f05143729f9849b4edefe01b1a02e fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O -inline https://github.com/dlang/dmd/commit/b054a20d288db623c91ccbb9f2fb1e9f64e5f100 Merge pull request #6566 from MartinNowak/fix17215
Comment #8 by github-bugzilla — 2017-03-07T23:18:04Z
Commit pushed to revert-6566-fix17215 at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/4373a211ed16d05650aeb1779881b12e09c2ca80 Revert "fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O -inline"
Comment #9 by github-bugzilla — 2017-08-07T13:15:18Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/46d1948f4c4f05143729f9849b4edefe01b1a02e fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O -inline https://github.com/dlang/dmd/commit/b054a20d288db623c91ccbb9f2fb1e9f64e5f100 Merge pull request #6566 from MartinNowak/fix17215