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

LLVM generates unreachable call stack adjustments after noreturn functions when the frame is not reserved #27491

Closed
rnk opened this issue Mar 29, 2016 · 3 comments
Labels
bugzilla Issues migrated from bugzilla llvm:codegen

Comments

@rnk
Copy link
Collaborator

rnk commented Mar 29, 2016

Bugzilla Link 27117
Resolution FIXED
Resolved on May 20, 2016 10:52
Version trunk
OS Windows NT
Blocks #26673
CC @zmodem

Extended Description

Consider:

__declspec(noreturn) void crash(void );
void g(void
);
void f(int c) {
void *p = _alloca(c);
if (c)
crash(p);
g(p);
}

Here is the call to 'crash':
.LBB0_1: # %if.then
callq "?crash@@YAXPEAX@Z"
addq $32, %rsp
ud2

The ADD RSP instruction is dead. On Windows, it is very common to not have a reserved call frame because of inalloca.

Maybe the right fix here is to teach MI more about noreturn functions so we can do more general DCE after them. It would also help us get rid of TrapOnUnreachable in favor of inserting int3 after all noreturn calls.

@rnk
Copy link
Collaborator Author

rnk commented Mar 29, 2016

This is worth doing because it comes up on every assert-like construct.

@zmodem
Copy link
Collaborator

zmodem commented May 20, 2016

r270109

@rnk
Copy link
Collaborator Author

rnk commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#45064

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 llvm:codegen
Projects
None yet
Development

No branches or pull requests

2 participants