Skip to content

Keep volatile indirections of promoted struct fields - #136940

Open
NinoFloris wants to merge 1 commit into
dotnet:mainfrom
NinoFloris:jit/volatile-struct-fields
Open

NinoFloris wants to merge 1 commit into
dotnet:mainfrom
NinoFloris:jit/volatile-struct-fields

Conversation

@NinoFloris

Copy link
Copy Markdown
Contributor

Fixes #136936, a longstanding bug that was kept around as a quirk for zero-diffs at the time. Disasm tests here are a bit fragile, though arm has stabilized its instructions around this now, but I'd rather have them than not.

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 3, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 3, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch

jakobbotsch commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Disasm tests here are a bit fragile, though arm has stabilized its instructions around this now, but I'd rather have them than not.

I don't agree. These tests are much too fragile, relying on exact promotion heuristics that are going to be changing in this release. I don't think the test is needed.

I would be ok with outerloop test that validates that a volatile load was not dropped by testing for a race.

@jakobbotsch

Copy link
Copy Markdown
Member

a longstanding bug that was kept around as a quirk for zero-diffs at the time

FWIW, this used to have quite significant diffs around structs that were later proved to be not exposed. Looks like something changed since the diffs are very minimal now, however.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Volatile reads of a promoted struct's field lose volatile semantics when the struct is address-exposed

2 participants