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

            Bug ID: 19007
           Summary: Destructor alias emission ignores calling convention
           Product: clang
           Version: trunk
          Hardware: PC
               URL: http://www.freebsd.org/cgi/query-pr.cgi?pr=187103
                OS: All
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Here's a mildly insane test case reduced from mozilla.

$ cat t.cc
#define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))

struct nsCOMPtr_base {
  NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base() {}
};

struct nsCOMPtr : private nsCOMPtr_base {};

int main() {
  nsCOMPtr ptr;
}

$ clang -target i386-linux-gnu -O1 -Xclang -disable-llvm-optzns -flto -S -o -
t.cc
define i32 @main() #0 {
entry:
  %ptr = alloca %struct.nsCOMPtr, align 1
  call void bitcast (void (%struct.nsCOMPtr_base*)* @_ZN13nsCOMPtr_baseD2Ev to
void (%struct.nsCOMPtr*)*)(%struct.nsCOMPtr* %ptr)
  ret i32 0
}

define linkonce_odr x86_stdcallcc void
@_ZN13nsCOMPtr_baseD2Ev(%struct.nsCOMPtr_base* inreg %this)



Here we create a call to @_ZN13nsCOMPtr_baseD2Ev without adding the
x86_stdcallcc attribute to the call. The optimizer will turn this into a call
to @llvm.trap.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to