Repository navigation
with migrate lowers a GNU statement expression used as a value: its statements, then its last expression (#955) - #3569
Merged
Merged
Conversation
added 2 commits
November 23, 2026 11:13
…tatements, then its last expression (#955)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #955. Does not close it.
with migratelowered a GNU statement expression only where its value was discarded (and one<math.h>comparison form). As a value it was refused:unsupported assignment rhs in goto CFG (kind=121), or a bail at the declaration inside it.Now
x = ({ T t = …; t * 2; })is its statements, in order, followed by its last expression as the value:__local_t,__local_t_1), so two statement expressions declaring one name do not collide;No new mechanism: it uses the setup-plus-value form the conditional and
?:lowerings already return.Test.
bs_check_migrate_statement_expression_values(basic migrator lane): a C program whosemainreturns the number of the first wrong result, covering the three positions, same-named locals, a goto-lowered function building a record through one, and evaluation count and order. The migrated program returns 0 as C does.Roundtrip after this. The function this was found in (
Compilation.bundle_contract_rows) now stops one step later, at__builtin_alloca, which the C backend uses on purpose for a closure created in a loop. With has no stack-allocation primitive, so that is a language question and is recorded on #955, not worked around here.:c-migrator-testsgreen. Battery green (926 s); self-audit and:release-checksgreen (590 s).