Skip to content
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

Only update Eq operands in GVN if it can update both sides #127105

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

scottmcm
Copy link
Member

Otherwise the types might not match

Fixes #127089

r? mir-opt

Otherwise the types might not match

Fixes 127089
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 29, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 29, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

// skip-filecheck
//@ test-mir-pass: GVN
//@ only-64bit
//@ compile-flags: -Z mir-enable-passes=+Inline
Copy link
Member Author

Choose a reason for hiding this comment

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

This was enough to ICE it. If godbolt has updated to a new enough by the time you see this, hopefully that'll repro at https://rust.godbolt.org/z/84f4Ed3Kd.

- _6 = const Foo::<u8>::SENTINEL as *const u8 (PtrToPtr);
- _1 = Eq(_4, _6);
+ _6 = const {0x1 as *const u8};
+ _1 = const true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test that does not reduce to a constant ?
R=me afterwards

@scottmcm
Copy link
Member Author

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Jun 30, 2024

📌 Commit f694211 has been approved by cjgillot

It is now in the queue for this repository.

@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 Jun 30, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 1, 2024
Only update `Eq` operands in GVN if it can update both sides

Otherwise the types might not match

Fixes rust-lang#127089

r? mir-opt
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 1, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126923 (test: dont optimize to invalid bitcasts)
 - rust-lang#127090 (Reduce merge conflicts from rustfmt's wrapping)
 - rust-lang#127105 (Only update `Eq` operands in GVN if it can update both sides)
 - rust-lang#127150 (Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins`)
 - rust-lang#127181 (Introduce a `rustc_` attribute to dump all the `DefId` parents of a `DefId`)
 - rust-lang#127182 (Fix error in documentation for IpAddr::to_canonical and Ipv6Addr::to_canonical)
 - rust-lang#127191 (Ensure `out_of_scope_macro_calls` lint is registered)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6938b4b into rust-lang:master Jul 1, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 1, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 1, 2024
Rollup merge of rust-lang#127105 - scottmcm:issue-127089, r=cjgillot

Only update `Eq` operands in GVN if it can update both sides

Otherwise the types might not match

Fixes rust-lang#127089

r? mir-opt
@scottmcm scottmcm deleted the issue-127089 branch July 1, 2024 11:59
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.

ICE: Cannot Eq compare incompatible types *mut T/#0 and *const T/#0
5 participants