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.
Comment #1 by bugzilla — 2014-06-04T20:45:29Z
Comment #2 by github-bugzilla — 2014-06-09T00:53:50Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/36bc3e87ddd302c72e8579d68036c5d7accac220 fix Issue 12855 - Shadow register assignments for spilling can conflict https://github.com/D-Programming-Language/dmd/commit/161e453b95527a92982e6e7cc22c880035edd57a Merge pull request #3622 from WalterBright/fix12855 fix Issue 12855 - Shadow register assignments for spilling can conflict
Comment #3 by github-bugzilla — 2014-06-09T02:18:50Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c0d0452f7c41636b46a928b52cdc2762993339b2 Merge pull request #3622 from WalterBright/fix12855 fix Issue 12855 - Shadow register assignments for spilling can conflict