Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructor alias emission ignores calling convention #19381

Closed
d0k opened this issue Feb 28, 2014 · 1 comment
Closed

Destructor alias emission ignores calling convention #19381

d0k opened this issue Feb 28, 2014 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang:codegen miscompilation

Comments

@d0k
Copy link
Member

d0k commented Feb 28, 2014

Bugzilla Link 19007
Resolution FIXED
Resolved on Mar 05, 2014 15:05
Version trunk
OS All
CC @DimitryAndric,@emaste,@rnk

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.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 5, 2014

fixed in r203007 .

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:codegen miscompilation
Projects
None yet
Development

No branches or pull requests

2 participants