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

--- Comment #0 from 2011-05-21 05:36:44 PDT ---
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();;


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:
------- You are receiving this mail because: -------

Reply via email to