Bug 9115 – Internal error when compiling core.simd float4 expression
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-05T16:55:00Z
Last change time
2016-04-25T06:50:45Z
Keywords
ice, SIMD
Assigned to
nobody
Creator
fak
Comments
Comment #0 by fak — 2012-12-05T16:55:00Z
Trying to compile this program:
---
import std.stdio;
import core.simd;
void main()
{
float4 a = 0;
float4 b = 1;
writefln ("a = %(%s %)", a.array);
writefln ("b = %(%s %)", b.array);
//float4 c = a - b; //this works
//writefln ("a - b = %(%s %)", c.array); //this doesn't
writefln ("a - b = %(%s %)", (a-b).array); //this doesn't
}
---
Results in "Internal error: e2ir.c 155" with "DMD64 D Compiler v2.060" on OS X 10.8.2
The errors seems to be with the expression "(a-b).array". If I use a variable to store the expression value first, then all is well.
This gives the following message with the current compiler:
foo.d(16): Error: array operation a - b without destination memory not allowed
As you say, using a temporary allows it to work. It's a limitation, but not a bug.