Here is two cases: 1) pass vector by ref, return, compare, ...ICE 2) apply op, compare, fail with exit code -11 import core.simd; int4 f() { int4 vec; return vec; } void main() { int4 vec; assert(f.array == [-1, -1, -1, -1]); /* catch-bug ~master: building configuration "application"... Internal error: backend/cod1.c 1669 dmd failed with exit code 1. */ //assert((-vec).array == [-1, -1, -1, -1]); /* catch-bug ~master: building configuration "application"... dmd failed with exit code -11. */ } In second case could be used unary or binary operator (v1 & v2), (-vec), ... DMD64 D Compiler v2.070
crashes are gone however there's another bug I'll open. Unary operators modify while they should return a modified copy.
No actually everything is fine import core.simd; int4 f() { int4 vec = [-1, -1, -1, -1]; return vec; } void main() { assert(f().array == [-1, -1, -1, -1]); int4 v2 = f(); assert(v2.array == [-1, -1, -1, -1]); int4 vec = [1, 1, 1, 1]; assert((-vec).array == [-1, -1, -1, -1]); int4 neg = -vec; assert(neg.array == [-1, -1, -1, -1]); neg = -neg; assert(neg.array == [1, 1, 1, 1]); }