Destructor alias emission ignores calling convention #19381
Labels
bugzilla
Issues migrated from bugzilla
clang:codegen
IR generation bugs: mangling, exceptions, etc.
miscompilation
Extended Description
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.
The text was updated successfully, but these errors were encountered: