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

licm miscompile with noalias and call which exits program #28231

Closed
efriedma-quic opened this issue May 24, 2016 · 1 comment
Closed

licm miscompile with noalias and call which exits program #28231

efriedma-quic opened this issue May 24, 2016 · 1 comment
Labels
bugzilla Issues migrated from bugzilla loopoptim

Comments

@efriedma-quic
Copy link
Collaborator

Bugzilla Link 27857
Resolution FIXED
Resolved on Jun 11, 2016 17:20
Version trunk
OS Windows NT
CC @sanjoy

Extended Description

Testcase:

#include <stdlib.h>
void f() { exit(0); }
void (ff)() = f;
void g(int
restrict a) {
for (int i = 0; i < 1000; ++i) {
ff();
*a += 1;
}
}
void (gg)(int restrict) = g;
int main() {
gg(0);
}

Works with gcc and clang -O0; crashes with clang -O2.

I think LICM is relying too much on "MayThrow" to conclude that function calls will return normally.

Testcase is artificial.

@efriedma-quic
Copy link
Collaborator Author

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 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 loopoptim
Projects
None yet
Development

No branches or pull requests

1 participant