[Issue 12855] New: Shadow register assignments for spilling can conflict

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jun 4 12:10:24 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12855

          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 at puremagic.com
          Reporter: bugzilla at 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.

--


More information about the Digitalmars-d-bugs mailing list