Skip to content

No longer marking blocks with labels with invariants as loop head blocks if they aren't loop heads#859

Merged
marcoeilers merged 5 commits into
masterfrom
meilers_fix_non_loop_head_inv_labels
Mar 19, 2025
Merged

No longer marking blocks with labels with invariants as loop head blocks if they aren't loop heads#859
marcoeilers merged 5 commits into
masterfrom
meilers_fix_non_loop_head_inv_labels

Conversation

@marcoeilers

Copy link
Copy Markdown
Contributor

This fixes viperproject/silicon#525 and viperproject/silicon#607.

The code used to mark every block starting with a label with an invariant as a loop head block, even if it's not.
This PR changes that by first of all making blocks starting with labels with invariants as normal statement blocks, which remember the invariant and loop ID they should have if they turn out to be loop heads.
Later, when we discover that such a block is actually a loop head, we use the existing code that transforms it into a loop head code, and extend this code to retrieve the invariant that is now stored in the statement block.

Also adding a few more test cases for goto-loops.

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.

Label with invariant potentially incorrectly handled

1 participant