Bug 15018 – Win64: ICE when assigning struct of size 4 to slice
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-09-05T16:33:00Z
Last change time
2015-09-08T00:05:19Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
r.sagitario
Comments
Comment #0 by r.sagitario — 2015-09-05T16:33:47Z
Slight variation of issue 11596:
/////
struct S { short[2] m; }
S f()
{
S s;
return s;
}
void g(S s) {}
void h()
{
S[3] s3;
s3[] = f();
}
/////
Compiling with git-head or dmd 2.068 for Win64 yields:
Internal error: backend\cgcs.c 355
Comment #1 by r.sagitario — 2015-09-05T16:35:43Z
AFAICT the problem is that the return value of f() is passed in a register, but the slice assignments tries to take the address of that value without making a local copy.
Comment #2 by github-bugzilla — 2015-09-08T00:05:18Z