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 restrict and throw #28326

Closed
efriedma-quic opened this issue May 31, 2016 · 2 comments
Closed

licm miscompile with restrict and throw #28326

efriedma-quic opened this issue May 31, 2016 · 2 comments
Labels
bugzilla Issues migrated from bugzilla loopoptim

Comments

@efriedma-quic
Copy link
Collaborator

Bugzilla Link 27952
Resolution FIXED
Resolved on Jun 05, 2016 17:15
Version trunk
OS Windows NT
CC @hfinkel,@sanjoy

Extended Description

Testcase:

#include <stdlib.h>

void t() { throw 0; }
void (tt)() = t;
void f(int
__restrict a, int x, bool y) {
for (int i = 0; i < x; ++i) {
*a += 1;
if (y) tt();
}
}
void (ff)(int__restrict,int,bool) = f;
int main() {
int a = 0;
try {
ff(&a, 10, true);
} catch (...) {
if (a != 1) abort();
}
}

Runs to completion with clang -O0, aborts with clang -O2.

The problem is incomplete safety checks in LICM.

(Artificial testcase.)

@efriedma-quic
Copy link
Collaborator Author

@efriedma-quic
Copy link
Collaborator Author

r271858.

@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