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