Skip to content

goto-symex constant propagation peculiarities #3095

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

Open
tautschnig opened this issue Oct 4, 2018 · 0 comments
Open

goto-symex constant propagation peculiarities #3095

tautschnig opened this issue Oct 4, 2018 · 0 comments

Comments

@tautschnig
Copy link
Collaborator

CBMC version: 5.10 a1e86d3
Operating system: any
Exact command line resulting in the issue: n/a
What behaviour did you expect: To understand why constant propagation is restricted as it is
What happened instead: Constant propagation in goto-symex is limited to expressions with ids
ID_typecast, ID_array_of, ID_plus, ID_array, ID_struct, ID_union, ID_byte_update_big_endian, ID_byte_update_little_endian, and ID_address_of -- if all operands are constants. Furthermore ID_mult is always deemed constant irrespective of its operands, and ID_with is never constant. It is not clear why this specific set of operations was chosen, and ID_with is explained as "this is bad."

tautschnig added a commit to tautschnig/cbmc that referenced this issue May 29, 2023
We would only deem with_exprt constant when all their operands are
constant, which means that the array operand must be an array or
array_of expression, and both update indices as well as update values
must be constant. In most such cases the simplifier would rewrite the
with_exprt anyway. The exception to this is an index that cannot
immediately be evaluated to a numeric constant, as is the case with,
e.g., pointer_object expressions.

Fixes: diffblue#3095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant