transpile: Consider volatile reads a side effect - #1978
Open
Rua wants to merge 4 commits into
Open
Conversation
Rua
force-pushed
the
volatile-read-side-effect
branch
4 times, most recently
from
August 20, 2026 14:53
d26719b to
8cd218b
Compare
Rua
marked this pull request as ready for review
August 20, 2026 14:58
Rua
force-pushed
the
volatile-read-side-effect
branch
from
August 20, 2026 15:12
8cd218b to
627f712
Compare
Rua
force-pushed
the
volatile-read-side-effect
branch
from
August 22, 2026 08:25
627f712 to
62b90e1
Compare
Rua
force-pushed
the
volatile-read-side-effect
branch
from
August 23, 2026 13:09
62b90e1 to
476a77c
Compare
This was referenced Aug 23, 2026
ahomescu
approved these changes
Aug 25, 2026
| let mut y: bar = bar { | ||
| x: x as ::core::ffi::c_int, | ||
| } as bar; | ||
| let mut y: bar = bar { x: x }; |
Contributor
There was a problem hiding this comment.
Are these side effects of the new code, or something that was there before?
| // https://github.com/immunant/c2rust/issues/1237 | ||
| --(volatile_global_struct.p); | ||
|
|
||
| // Unused reads, should be included as side effects. |
Contributor
There was a problem hiding this comment.
Add a case for volatile struct member reads?
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.
Fixes the issue noted in #1975 (comment), that volatile reads with unused results are omitted when they shouldn't be.