-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Assertion failure only when compiling with -O #2989
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I have now done a little more investigation. Using the following code, which is a simplified version of the original that also has some io::println added for debugging:
Compilation without -O produces the expected output:
And compilation with -O produces some strange output and an assertion failure:
Its like the optimized code is producing bools that are off by 192. |
Just in case this might be useful... when this code was inside std::bitv then the test suite failed valgrind with a bunch of stuff like:
|
This now seems to be fixed - the assertion failures that were occurring in the examples above no longer seem to happen. |
Thanks for following up on this @Dretch. I added the test case. |
miri: implement some `llvm.x86.sse.*` intrinsics and add tests PR moved from rust-lang#113932. Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`. Also adds miri tests for those functions (mostly copied from core_arch tests). r? `@RalfJung` The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
I tried applying model-checking/kani#2983 fix, however, this would require user to import `__kani_workaround_core_assert`. To fix that, I moved the definition to be under `kani` crate. I replaced the existing fixme test. Initially I didn't check we had one, and I created a second one which is simpler (no cargo needed) but that also includes other cases. Resolves rust-lang#2187
The assert in this crate (which is derived from std::bitv) passes when compiled without -O and fails when compiled with -O:
As mentioned in a comment in the code the position of the items in the crate also seem to be significant. Removing
some_unused_fn
and/ormethods
also makes the code work as expected.This bug is blocking #2964 and possibly #2341.
I found this bug on a 64 bit Ubuntu system.
The text was updated successfully, but these errors were encountered: