Bug 12377 – ICE (backend\cgxmm.c 622) on x64 for math on cdouble array items

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-03-15T21:37:31Z
Last change time
2020-03-21T03:56:42Z
Keywords
ice, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev

Attachments

IDFilenameSummaryContent-TypeSize
1352test_12377.dTest casetext/x-c3559

Comments

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