Skip to content

Library functions may require converting additional inline functions - #7475

Merged
kroening merged 2 commits into
diffblue:developfrom
tautschnig:bugfixes/library-inline
Jan 13, 2023
Merged

kroening merged 2 commits into
diffblue:developfrom
tautschnig:bugfixes/library-inline

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

Library functions may make use of (inline) functions defined in header files. One such case is copysignf, which uses signbit, which in turn is inlined on macOS. When these functions hadn't been seen before linking the library, then converting just the library_model symbol table would be insufficient for it would not include functions outside our own model library. Fall back to the goto_model symbol table for those cases.

This was originally reported via Kani in
model-checking/kani#1993.

  • 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.

@tautschnig tautschnig added bugfix aws Bugs or features of importance to AWS CBMC users aws-high Kani Bugs or features of importance to Kani Rust Verifier labels Jan 12, 2023
@tautschnig
tautschnig force-pushed the bugfixes/library-inline branch from 7f67b8f to ddb5022 Compare January 12, 2023 11:15
@tautschnig tautschnig self-assigned this Jan 12, 2023
@tautschnig
tautschnig force-pushed the bugfixes/library-inline branch from ddb5022 to 90e4a9a Compare January 12, 2023 13:52
@tautschnig tautschnig removed their assignment Jan 12, 2023
GCC's __builtin_signbit is type-generic, and therefore does not entail a
cast from float to double. Such a cast would not necessarily preserve
the sign in case of NaN.
Library functions may make use of (inline) functions defined in header
files. One such case is `copysignf`, which uses `signbit`, which in turn
is inlined on macOS. When these functions hadn't been seen before
linking the library, then converting just the `library_model` symbol
table would be insufficient for it would not include functions outside
our own model library. Fall back to the `goto_model` symbol table for
those cases.

This was originally reported via Kani in
model-checking/kani#1993.
@tautschnig
tautschnig force-pushed the bugfixes/library-inline branch from 90e4a9a to d8f7930 Compare January 12, 2023 13:54

@martin-cs martin-cs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following an offline discussion with @tautschnig I am confident the floating-point behaviours is "correct enough".

@codecov

codecov Bot commented Jan 12, 2023

Copy link
Copy Markdown

Codecov Report

Base: 78.48% // Head: 78.48% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (d8f7930) compared to base (ff62607).
Patch coverage: 81.66% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7475   +/-   ##
========================================
  Coverage    78.48%   78.48%           
========================================
  Files         1663     1663           
  Lines       191189   191186    -3     
========================================
+ Hits        150046   150054    +8     
+ Misses       41143    41132   -11     
Impacted Files Coverage Δ
src/ansi-c/c_typecheck_expr.cpp 76.06% <ø> (ø)
src/ansi-c/expr2c_class.h 100.00% <ø> (ø)
src/goto-symex/goto_symex.h 86.66% <ø> (ø)
src/goto-symex/ssa_step.h 100.00% <ø> (ø)
src/goto-symex/symex_assign.cpp 81.15% <ø> (ø)
src/goto-symex/symex_target.h 100.00% <ø> (ø)
src/goto-symex/symex_target_equation.h 100.00% <ø> (ø)
src/util/pointer_expr.h 96.72% <25.00%> (ø)
src/ansi-c/expr2c.cpp 67.71% <53.84%> (ø)
src/goto-symex/field_sensitivity.cpp 93.28% <83.33%> (ø)
... and 42 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kroening
kroening merged commit 1f088d7 into diffblue:develop Jan 13, 2023
@tautschnig
tautschnig deleted the bugfixes/library-inline branch January 13, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws Bugs or features of importance to AWS CBMC users aws-high bugfix Kani Bugs or features of importance to Kani Rust Verifier

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants