Bug 12855 – Shadow register assignments for spilling can conflict
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-06-04T19:10:00Z
Last change time
2014-06-09T02:18:50Z
Keywords
wrong-code
Assigned to
nobody
Creator
bugzilla
Comments
Comment #0 by bugzilla — 2014-06-04T19:10:24Z
For the following piece of code, compiled for Win64 with -O and SFLexit added to __arrayZ:
void test8651() {
real[3] a = [11, 22, 33];
real[3] b = [1, 2, 3];
a[] += 4 + b[];
}
it will generate:
mov RDX,R8
mov R8,RDX
as shadow reg R8 is assigned to RDX and vice versa. The code sequence generated, obviously, winds up trashing R8.