Comment #0 by dlang-bugzilla — 2014-03-15T21:37:31Z
cdouble fun(cdouble[] a)
{
return a[0] + a[0];
}
Comment #1 by dlang.element126 — 2014-05-04T10:39:18Z
Created attachment 1352
Test case
Here is some extra information and commented test cases about DMD (64 bit, 2.065) ICEs (backend\cgxmm.c 622 and 647) with arrays of complex numbers.
This code compiles and all unit tests pass with GDC 4.9.0 and LDC2 0.12.0 (both 64 bit).
There are actually two distinct issues :
- ICEs when function/delegate directly returns the sum (622) or difference (647) of two built-in complex numbers.
- segfault with cfloat at line 13, when using vector operation array[] = scalar;
It seems that DMD tries to optimize these operations using SSE instructions for float and double complex types, but not real (no 80-bit SSE instructions).
It reaches an assert(0) in function 'unsigned xmmoperator(tym_t tym, unsigned oper);' in file backend\cgxmm.c .
Multiplication and division works correctly.
The code can also be found at http://dpaste.dzfl.pl/a93ad0763d62