www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12855] New: Shadow register assignments for spilling can


          Issue ID: 12855
           Summary: Shadow register assignments for spilling can conflict
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

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.

Jun 04 2014