Skip to content

Simplify inequality over pointers #7650

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

Merged

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Apr 4, 2023

When using pointers as iterators we may see less-than (or less-or-equal) comparison of pointers with some offsets. When the base pointers point to the same root object we can safely simplify this.

  • 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 self-assigned this Apr 4, 2023
@tautschnig tautschnig marked this pull request as ready for review April 18, 2023 14:58
@tautschnig tautschnig force-pushed the features/less-than-pointer-simp branch 2 times, most recently from 3c2bd1f to c697839 Compare April 18, 2023 15:07
@tautschnig tautschnig force-pushed the features/less-than-pointer-simp branch from c697839 to 3cd771e Compare April 20, 2023 19:56
When using pointers as iterators we may see less-than (or less-or-equal)
comparison of pointers with some offsets. When the base pointers point
to the same root object we can safely simplify this.

Also avoid undefined behaviour (pointer below object bounds) in
regression test.
@tautschnig tautschnig force-pushed the features/less-than-pointer-simp branch from 3cd771e to 25a050a Compare April 21, 2023 10:19
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.11 ⚠️

Comparison is base (f39a5c1) 78.52% compared to head (25a050a) 78.41%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7650      +/-   ##
===========================================
- Coverage    78.52%   78.41%   -0.11%     
===========================================
  Files         1674     1674              
  Lines       191971   191970       -1     
===========================================
- Hits        150738   150534     -204     
- Misses       41233    41436     +203     
Impacted Files Coverage Δ
src/util/simplify_expr_int.cpp 88.43% <100.00%> (-0.02%) ⬇️

... and 12 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@peterschrammel peterschrammel removed their assignment May 5, 2023
@tautschnig tautschnig merged commit 71d07e0 into diffblue:develop May 5, 2023
@tautschnig tautschnig deleted the features/less-than-pointer-simp branch May 5, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants