Skip to content

explain why shift with signed offset works the way it does #94659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Mar 6, 2022

I was worried for a bit here that Miri/CTFE would be inconsistent with codegen, but I think everything is all right, actually.

Cc @oli-obk @eddyb

@rust-highfive
Copy link
Contributor

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 6, 2022
@rust-highfive
Copy link
Contributor

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 6, 2022
bors added a commit to rust-lang/miri that referenced this pull request Mar 6, 2022
add extra tests for shifts with negative offsets

Cc rust-lang/rust#94659
// zero-extended form). This matches the codegen backend:
// <https://github.com/rust-lang/rust/blob/f047af24b3b90f19b89fac80822acd69613b89ec/compiler/rustc_codegen_ssa/src/base.rs#L315-L317>.
// The overflow check is also ignorant to the sign:
// <https://github.com/rust-lang/rust/blob/8fae33d9b21e1e29da65506a2d6ac5bbbb3c4a86/compiler/rustc_codegen_ssa/src/mir/rvalue.rs#L728>.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like permalinks too much in comments, especially two of them so close to each other but at different commits.

I don't have a good solution that won't cause the information to go stale though. At best we could have some soft of rustdoc link that will get complained about if it breaks and then link to the function in codegen.

Oh well, let's merge it, but please use the same commit id.

@RalfJung
Copy link
Member Author

RalfJung commented Mar 6, 2022

Oh well, let's merge it, but please use the same commit id.

All right.
@bors r=oli-obk rollup=always

@bors
Copy link
Collaborator

bors commented Mar 6, 2022

📌 Commit dfc43df has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 6, 2022
…askrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#94659 (explain why shift with signed offset works the way it does)
 - rust-lang#94671 (fix pin doc typo)
 - rust-lang#94672 (Improved error message for failed bitcode load)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c2d2f6f into rust-lang:master Mar 6, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 6, 2022
@RalfJung RalfJung deleted the signed-shift branch March 7, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants