Skip to content

Conversation

kroening
Copy link
Member

C99 states that the behavior of abs, labs, llabs, imaxabs is undefined when the result of computing the absolute value is not representable. This commit adds preconditions to the library models that catch this case.

It is unclear whether the same preconditions should be added for the GCC builtins.

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

@kroening kroening force-pushed the abs-preconditions branch 2 times, most recently from 8ed9e55 to 9021091 Compare July 24, 2023 18:04
C99 states that the behavior of abs, labs, llabs, imaxabs is undefined when
the result of computing the absolute value is not representable.  This
commit adds preconditions to the library models that catch this case.
@kroening kroening force-pushed the abs-preconditions branch from 9021091 to d1dc64f Compare July 24, 2023 18:32
@kroening kroening marked this pull request as ready for review July 24, 2023 18:46
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.20% 🎉

Comparison is base (63b8b71) 78.13% compared to head (d1dc64f) 78.34%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7825      +/-   ##
===========================================
+ Coverage    78.13%   78.34%   +0.20%     
===========================================
  Files         1698     1698              
  Lines       194027   194027              
===========================================
+ Hits        151600   152004     +404     
+ Misses       42427    42023     -404     

see 53 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tautschnig tautschnig merged commit 895d6dd into develop Aug 1, 2023
@tautschnig tautschnig deleted the abs-preconditions branch August 1, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants