Skip to content

Conversation

@whitequark
Copy link
Contributor

This PR adds std::unsafe::intrinsics::{volatile_load,volatile_store}, which map to LLVM's load volatile and store volatile operations correspondingly.

This would fix #11172.

I have addressed several uncertainties with this PR in the line comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is returning undef of type nil here actually safe? It seems to be, but I don't understand the details of this operation nor any way to exercise this code path.

@whitequark
Copy link
Contributor Author

Updated, tests now check for presence of volatile instructions in bitcode. I think the PR can be merged now.

/cc @thestinger

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better as use std::unstable::intrinsics::{volatile_load, volatile_store}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what the other intrinsic tests used. I'll fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

bors added a commit that referenced this pull request Dec 31, 2013
This PR adds `std::unsafe::intrinsics::{volatile_load,volatile_store}`, which map to LLVM's `load volatile` and `store volatile` operations correspondingly.

This would fix #11172.

I have addressed several uncertainties with this PR in the line comments.
@bors bors closed this Jan 1, 2014
@bors bors merged commit f98f83a into rust-lang:master Jan 1, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 31, 2023
…=Manishearth

Don't lint `needless_return` in fns across a macro boundary

Fixes rust-lang#11167

changelog: none
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.

No way to emit volatile loads/stores

5 participants