www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6042] New: registers not preserved across method call

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6042

           Summary: registers not preserved across method call
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dawg dawgfoto.de



void destroysXMM1(float a, float b) {
}

void assertSame(float a, float b) {
  assert(a == b);
}

class Bug {
   property float xval() const {
    destroysXMM1(0.0f, 0.0f);
    return 2.0f;
  }

  void show() {
    assertSame(xval, xval);
  }
}

void main() {
  auto bug = new Bug();
  bug.show();
}

----

This is the generated code.
mov    0xfffffffffffffff8(%rbp),%rdi
mov    (%rdi),%rax
rex64 callq  *0x30(%rax)
movsd  %xmm0,0xfffffffffffffff0(%rbp)
movsd  0xfffffffffffffff0(%rbp),%xmm1
mov    0xfffffffffffffff8(%rbp),%rdi
mov    (%rdi),%rcx
rex64 callq  *0x30(%rcx)
callq  40162c <_D3bug10assertSameFffZv>

The return value of the first parameter evaluation is moved to xmm1 before the
other parameter gets evaluated.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 21 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6042


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 6189 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 21 2011