Bug 11585 – ICE(cgcod.c) with SIMD and -O

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-23T17:25:00Z
Last change time
2016-10-01T11:46:38Z
Keywords
ice, SIMD
Assigned to
nobody
Creator
Marco.Leise

Comments

Comment #0 by Marco.Leise — 2013-11-23T17:25:36Z
When the following code is compiled with "dmd2.064 -defaultlib=phobos2 -O -release -inline -noboundscheck -L--as-needed -L-s" it causes an ICE, presumably because the same reference to a SIMD vector is used twice in the intrinsics, as the second assignment to x demonstrates. The first assignment is more or less the real code I tried to compile and shows how several references to the same vector can occur in SSE calculations. ---------------8<------------------ import core.simd; void main() { foo(null); } ubyte16 x; void foo(ubyte16* d) { if (d is null) return; ubyte16 a, b; // both assignments break cgcod.c x = __simd(XMM.POR, __simd(XMM.PCMPEQB, *d, a), __simd(XMM.PCMPEQB, *d, b)); x = __simd(XMM.PCMPEQB, *d, *d); } --------------->8------------------
Comment #1 by yebblies — 2013-11-23T19:18:40Z
Reduced fails with -m64 -O import core.simd; ubyte16 x; void foo(ubyte16* d) { if (d is null) return; ubyte16 a, b; x = __simd(XMM.PCMPEQB, *d, *d); }
Comment #2 by bugzilla — 2016-04-25T07:13:36Z
(In reply to yebblies from comment #1) > Reduced fails with -m64 -O findreg(0, line=2970, file='..\ztc\cod2.c', function = '_D5foo193fooFPNhG16hZv') Internal error: ..\ztc\cgcod.c 1666
Comment #3 by bugzilla — 2016-04-25T08:08:19Z
Comment #4 by github-bugzilla — 2016-04-29T20:05:23Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2430ad6779a9e56e71a0150bf9a7c39b4d10139a fix Issue 11585 - ICE(cgcod.c) with SIMD and -O https://github.com/dlang/dmd/commit/7c3ccd82cad2de2728f6bfbce1d3a673fb3e56d4 Merge pull request #5705 from WalterBright/fix11585 fix Issue 11585 - ICE(cgcod.c) with SIMD and -O
Comment #5 by github-bugzilla — 2016-10-01T11:46:38Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2430ad6779a9e56e71a0150bf9a7c39b4d10139a fix Issue 11585 - ICE(cgcod.c) with SIMD and -O https://github.com/dlang/dmd/commit/7c3ccd82cad2de2728f6bfbce1d3a673fb3e56d4 Merge pull request #5705 from WalterBright/fix11585