-
Notifications
You must be signed in to change notification settings - Fork 273
Perform remove_returns pass before constant_propagator #7105
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
Perform remove_returns pass before constant_propagator #7105
Conversation
The constant_propagator does not handle returns and gives unexpected results for examples including returns. Carrying out the remove_returns pass before contant propagation should resolve this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but really I would suggest using goto-analyzer for constant propagation:
goto-analyzer test --simplify test1 --vsd --vsd-value constants
@@ -1285,6 +1285,7 @@ void goto_instrument_parse_optionst::instrument_goto_program() | |||
if(cmdline.isset("constant-propagator")) | |||
{ | |||
do_indirect_call_and_rtti_removal(); | |||
remove_returns(goto_model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use do_remove_returns()
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Codecov Report
@@ Coverage Diff @@
## develop #7105 +/- ##
========================================
Coverage 77.87% 77.87%
========================================
Files 1576 1576
Lines 181588 181589 +1
========================================
+ Hits 141413 141415 +2
+ Misses 40175 40174 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This ensures that this pass is done only once and is shown in the logging.
@tautschnig Can you re-review this please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good as a partial workaround. Eventually, the constant propgator should be replaced by functionality from goto-analyzer, as @martin-cs suggests.
The constant_propagator does not handle returns and gives unexpected
results for examples including returns. Carrying out the remove_returns
pass before contant propagation should resolve this issue.
This relates to #7041