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

Fix count-trailing-zeros lowering for value zero #6703

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

tautschnig
Copy link
Collaborator

The previous implementation would produce an off-by-one error in case of
an argument 0, which count_trailing_zeros is defined for (even when
__builtin_ctz is undefined in that case).

Fixes: #6702

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

The previous implementation would produce an off-by-one error in case of
an argument 0, which count_trailing_zeros is defined for (even when
__builtin_ctz is undefined in that case).

Fixes: diffblue#6702
@kroening kroening removed their assignment Mar 1, 2022
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #6703 (e244103) into develop (1154f13) will increase coverage by 0.22%.
The diff coverage is 88.11%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6703      +/-   ##
===========================================
+ Coverage    76.92%   77.14%   +0.22%     
===========================================
  Files         1583     1582       -1     
  Lines       183314   182623     -691     
===========================================
- Hits        141018   140892     -126     
+ Misses       42296    41731     -565     
Impacted Files Coverage Δ
jbmc/src/java_bytecode/lazy_goto_model.h 100.00% <ø> (+7.40%) ⬆️
jbmc/src/jdiff/jdiff_parse_options.h 100.00% <ø> (ø)
src/cpp/cpp_typecheck_conversions.cpp 85.14% <0.00%> (+0.10%) ⬆️
src/goto-instrument/dump_c.cpp 80.49% <0.00%> (+0.28%) ⬆️
src/goto-instrument/dump_c_class.h 100.00% <ø> (ø)
src/goto-instrument/goto_program2code.cpp 68.84% <0.00%> (+0.06%) ⬆️
src/goto-programs/string_abstraction.cpp 92.45% <ø> (-0.01%) ⬇️
src/goto-programs/xml_expr.cpp 51.21% <0.00%> (ø)
src/util/expr_util.h 100.00% <ø> (ø)
src/util/pointer_predicates.cpp 93.10% <ø> (-0.45%) ⬇️
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 412d040...e244103. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected result when calling count intrinsics with zero
3 participants