[LLVMbugs] [Bug 13396] New: regparm not being applied to destructors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 18 20:08:53 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13396

             Bug #: 13396
           Summary: regparm not being applied to destructors
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Given

struct foo;
void f(foo*);
struct foo {
  __attribute__ ((regparm (3), noinline)) ~foo() {
    f(this);
  }
};
void bar(foo *x) {
  delete x;
}

Clang produces

00000000 <_ZN3fooD1Ev>:
   0:   e9 fc ff ff ff          jmp    1 <_ZN3fooD1Ev+0x1>

gcc produces:

00000000 <_ZN3fooD1Ev>:
   0:   83 ec 1c                sub    $0x1c,%esp
   3:   89 04 24                mov    %eax,(%esp)
   6:   e8 fc ff ff ff          call   7 <_ZN3fooD1Ev+0x7>
   b:   83 c4 1c                add    $0x1c,%esp
   e:   c3                      ret

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list