Skip to content

Remove unnecessary use of ns.follow in goto-programs/ #3761

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
merged 1 commit into from
Jan 12, 2019

Conversation

tautschnig
Copy link
Collaborator

Only structs, unions, enums can be hidden behind tags.

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

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 6eb9142).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97032295

@@ -96,7 +96,7 @@ void goto_convertt::remove_assignment(

exprt rhs;

const typet &op0_type=ns.follow(expr.op0().type());
const typet &op0_type = expr.op0().type();
Copy link
Contributor

Choose a reason for hiding this comment

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

Note the test at line 108 would therefore have been unreachable prior to this change -- but evidently our tests did not reveal that. Add a test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This not only was dead code, it actually still is dead code: the front-end already introduces type casts (both the C and C++ front-ends take care of this). I have, in a second commit, removed the dead code and added a PRECONDITION in the else case.

@tautschnig tautschnig force-pushed the no-follow-goto-programs branch 2 times, most recently from 65cd9a2 to 375e6db Compare January 11, 2019 15:00
@tautschnig tautschnig force-pushed the no-follow-goto-programs branch from 375e6db to 0cbacbc Compare January 11, 2019 15:05
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 375e6db).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97056355
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 0cbacbc).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97057429

@kroening
Copy link
Member

The first commit is definitively ok.
The second commit looks like there needs to be a fundamentally better approach to dealing with this -- it's odd that the conversion to goto would need to worry about promotion rules.

@kroening kroening assigned tautschnig and unassigned kroening Jan 12, 2019
Only structs, unions, enums can be hidden behind tags.
@tautschnig tautschnig force-pushed the no-follow-goto-programs branch from 0cbacbc to d4ec352 Compare January 12, 2019 15:17
@tautschnig
Copy link
Collaborator Author

I have moved the second commit to #3770.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: d4ec352).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97132922

@tautschnig tautschnig merged commit 49ac569 into diffblue:develop Jan 12, 2019
@tautschnig tautschnig deleted the no-follow-goto-programs branch January 12, 2019 16:33
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.

4 participants