Bug 7414 – Vector literal assignment doesn't work in global scope

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-31T11:12:00Z
Last change time
2012-05-01T14:05:32Z
Keywords
SIMD
Assigned to
nobody
Creator
turkeyman

Comments

Comment #0 by turkeyman — 2012-01-31T11:12:22Z
This causes the same error with or without 'immutable', but works fine within functions. // create some global constants private { immutable ulong2 signMask2 = 0x8000_0000_0000_0000; immutable uint4 signMask4 = 0x8000_0000; immutable ushort8 signMask8 = 0x8000; immutable ubyte16 signMask16 = 0x80; } $ /opt/gdc/bin/gdc test.d -O2 -S -msse2 test.d:101: Error: non-constant expression cast(immutable(__vector(ulong[2u])))9223372036854775808LU test.d:102: Error: non-constant expression cast(immutable(__vector(uint[4u])))-2147483648u test.d:103: Error: non-constant expression cast(immutable(__vector(ushort[8u])))32768 test.d:104: Error: non-constant expression cast(immutable(__vector(ubyte[16u])))128
Comment #1 by lovelydear — 2012-04-21T05:35:27Z
See also issue 7413
Comment #2 by github-bugzilla — 2012-05-01T14:04:34Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/545c0e187dee1cde236b88523d3389d39dee7f8c fix Issue 7414 - Vector literal assignment doesn't work in global scope