-
Notifications
You must be signed in to change notification settings - Fork 42
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
Clang inserts pointer "between" checks on high optimization #149
Comments
Can you post the generated .bc file? I'm not able to reproduce the error, seems like your clang may be generating different code than mine. |
@robdockins Here's the bitcode. This is generated with clang/llvm 5.0, but I can also try other versions if that's helpful. |
Interesting... the version you sent me has done some pretty aggressive inlining and vectorization and loop elimination. I can reproduce the error with this version, I'll see if I can track down what's going on. |
OK, so there are a number of interesting issues with this code.
Items 1 and 2 are now fixed in master Item 3 is a different ball of wax. The C standard says these kinds of comparisons are undefined behavior... but clang is happy to perform them and assume that there is some total ordering on allocated regions. The particular test it is doing (a pointer betweenness check) is a special idiom that actually doesn't depend on the particular ordering of regions, but recognizing this is difficult. Not exactly sure what to do about this. I'm pretty surprised clang is willing to insert this construct, actually. |
-O0
is not used
I think this issue can be resolved by the new lax pointer settings introduced in PR #294, once they get piped through to the SAW frontend. |
I've opened GaloisInc/saw-script#1308 to track the SAW-side changes needed to make this work. At this point, I don't think there is anything left to do Crucible-wise, so I'll close this in favor of GaloisInc/saw-script#1308. |
Running the Salsa20 SAW script example provided by @atomb for his tutorial leads to a pattern match failure for me by default.
When I add
-O0
to theclang
call in the Makefile, everything succeeds.SAW build: nightly 2019-01-29
This occurs with both clang/llvm 5.0 and 7.0 installed using Nix.
I can paste the SAW and C files if helpful, but they are contained in the saw-intro repository.
The text was updated successfully, but these errors were encountered: