Fix unaligned_volatile_store by removing MemFlags::UNALIGNED#158899
Conversation
|
|
| pub unsafe fn unaligned_volatile_store(a: *mut u8, b: u8) { | ||
| // CHECK: store volatile |
There was a problem hiding this comment.
Note that this test was essentially useless, since
- It didn't actually test the alignment used in the store, and
- It used
u8which always has alignment1even if you don't useunaligned.
So I expanded them to actually test things.
| // Note that only the store side is unaligned; the load from the argument is aligned. | ||
|
|
||
| // CHECK-NOT: memcpy | ||
| // CHECK: call void @llvm.memcpy{{.+}}(ptr align 1 %a, ptr align 2 %b, {{i16|i32|i64}} 14, i1 true) |
There was a problem hiding this comment.
A volatile memcpy is not actually a good way to do this, but it's not a regression at least since it's what this emits in nightly today (https://rust.godbolt.org/z/josnWhGa6).
(See danlehmann/bitfield#136 for more -- it's looking at this problem that had me looking at volatile stores at all. I'll make another PR after this one to work on that problem.)
|
@bors r+ rollup=iffy (Scott's codegen tests are usually good but codegen tests are famous for failing due to surprise target sensitivity) |
|
I appreciate your confidence in me, but also 100% agree with marking my codegen tests as iffy. I've had plenty of problems too 🙃 |
…saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes rust-lang#158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
…uwer Rollup of 17 pull requests Successful merges: - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #155429 (Support `u128`/`i128` c-variadic arguments) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158535 (Support `#[track_caller]` on EII declarations) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places")
…saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes rust-lang#158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
…saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes rust-lang#158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
…saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes rust-lang#158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
…uwer Rollup of 21 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #155429 (Support `u128`/`i128` c-variadic arguments) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes) - #159005 (Use `as_lang_item` instead of repeatedly matching)
…saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes rust-lang#158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
…uwer Rollup of 24 pull requests Successful merges: - #150946 (intrinsics: Add a fallback for non-const libm float functions) - #158510 (Enable `static_position_independent_executables` on all gnu and musl targets) - #158541 (Move `std::io::Write` to `core::io`) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #156027 (Consider captured regions for opaque type region liveness.) - #156370 (Reject linked dylib EII default overrides) - #156508 (Infer all anonymous lifetimes in assoc consts as `'static`) - #157561 (rustdoc: do not include extra stuff in span) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158859 (Improve `-Zls` diagnostic message on `.rs` files) - #158988 (Redo `TokenStreamIter`) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158384 (Allow BackwardIncompatibleDropHint in polonius legacy) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158739 (view-types: HIR lowering) - #158877 (borrowck: Keep returned `path` from `best_blame_constraint()` consistent) - #158883 (tests: fix enum-match.rs to handle LLVM 23) - #158886 (Add documentation for the `no_std` attribute) - #158940 (Implement feature `char_to_u32`) - #158951 (Merge three `MaxUniverse`s into one) - #158961 (Reapply "LLVM 23: Run AssignGUIDPass in some places") - #158995 (Use REST API in linkchecker script) - #158996 ([compiler] Implement `PartialOrd` via `Ord` for `Span` and newtype_indexes)
|
I presume this is the cause of #159037 (comment), as I don't see any other PRs in that rollup that could possibly cause over 4,000 tests to fail. @bors r- @bors try jobs=dist-i586-gnu-i586-i686-musl |
|
This pull request was unapproved. This PR was contained in a rollup (#159037), which was unapproved. |
This comment has been minimized.
This comment has been minimized.
Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` try-job: dist-i586-gnu-i586-i686-musl
|
Oh, joy, i586 :/ |
|
Good catch, I didn't see there was another codegen PR. I'll exclude both from rollups for the time being. |
|
💔 Test for 421a606 failed: CI. Failed job:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
That's not the "every UI test" failure, so let's see if it's transient... @bors try jobs=dist-i586-gnu-i586-i686-musl |
This comment has been minimized.
This comment has been minimized.
Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` try-job: dist-i586-gnu-i586-i686-musl
|
Re-approving since the try job above confirms this wasn't the source of the rollup issue @bors r=saethlin |
Rollup of 7 pull requests Successful merges: - #155429 (Support `u128`/`i128` c-variadic arguments) - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`) - #158640 (Handle nested inline consts in const argument checks) - #158866 ([perf] Add explicit `Iterator::count` impl for `ChunkBy`.) - #158912 (Introduce new bootstrap config section for PGO configuration) - #159040 (Print step stack trace when bootstrap panics) - #159056 (Print a loud error if the configured LLDB cannot be found)
Rollup merge of #158899 - scottmcm:better-volatile-store, r=saethlin Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED` Fixes #158897 There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead. r? codegen
Fixes #158897
There seems to be no reason to have this flag at all, as anything that wants it should just adjust the https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/place/struct.PlaceValue.html#structfield.align instead.
r? codegen