Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Fix a couple ICEs in the new `CastKind::Transmute` code by scottmcm · Pull Request #110021 · rust-lang/rust · GitHub
Skip to content

Fix a couple ICEs in the new CastKind::Transmute code - #110021

Merged
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005
Apr 10, 2023
Merged

Fix a couple ICEs in the new CastKind::Transmute code#110021
bors merged 2 commits into
rust-lang:masterfrom
scottmcm:fix-110005

Conversation

@scottmcm

@scottmcmscottmcm commented Apr 6, 2023

Copy link
Copy Markdown
Member

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes#110005
Fixes#109992
Fixes#110032
cc @matthiaskrgr

@rustbot

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbotrustbot 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 Apr 6, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm

Copy link
Copy Markdown
MemberAuthor

Oh, convenient, this accidentally made a repro of #109992 too 🙃

@scottmcmscottmcm changed the title Check CastKind::Transmute sizes in a better wayFix a couple ICEs in the new CastKind::Transmute codeApr 6, 2023
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
Comment threadcompiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r? @compiler-errors

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this check necessary?

For pairs you need to check the inner size because matching size of the whole pair doesn't necessarily imply matching sizes of elements... But surely the operand.layout.size != cast.size check is sufficient for scalars? 🤔

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, good call. Let me give that a shot -- might allow deleting more code too...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Removed this check, but ScalarOrZst::size is still needed elsewhere, so I couldn't remove more than that.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Oh, no, vectors. Without this check <4 x i64> to <8 x f32> trips the later debug-assert.

I suppose I could hypothetically bitcast that anyway, but I'm not doing that this PR.

Added some codegen tests for vectors so that when future me breaks this while running --keep-stage-std again, I'll notice without CI 😬

Comment threadtests/codegen/intrinsics/transmute.rs Outdated
@scottmcm
scottmcmforce-pushed the fix-110005 branch 2 times, most recently from 565e3db to 621417bCompareApril 7, 2023 21:22
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 621417bf7d51f9345d4e0669a150189e50a231db has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 621417bf7d51f9345d4e0669a150189e50a231db with merge 7deb56e0f1c0ca611132e8f7c025896c2398291e...

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 9, 2023
@rust-log-analyzer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor

r=me

@scottmcm

Copy link
Copy Markdown
MemberAuthor

I'd forgotten I made that test file only-64bit instead of my usual only-x86_64 🤦

@bors r=compiler-errors

@bors

bors commented Apr 9, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit d757c4b has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 Apr 9, 2023
@Dylan-DPCDylan-DPC mentioned this pull request Apr 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#109724 (prioritize param env candidates if they don't guide type inference)
- rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
- rust-lang#110044 (Avoid some manual slice length calculation)
- rust-lang#110115 (compiletest: Use remap-path-prefix only in CI)
- rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled)
- rust-lang#110124 (Some clippy fixes in the compiler)
Failed merges:
- rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit b872552 into rust-lang:masterApr 10, 2023
@rustbotrustbot added this to the 1.70.0 milestone Apr 10, 2023
@scottmcm
scottmcm deleted the fix-110005 branch April 11, 2023 01:46
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
Noratrieb added a commit to Noratrieb/rust that referenced this pull request May 30, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ``@compiler-errors``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 31, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? ```@compiler-errors```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 1, 2023
…ompiler-errors
Add a distinct `OperandValue::ZeroSized` variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than `Aggregate`s sometimes being `Immediates` (after all, I previously got that wrong and caused rust-lang#109992). As a minor bonus, it means we don't need to generate poison LLVM values for ZSTs to pass around in `OperandValue::Immediate`s.
Inspired by rust-lang#110021 (comment), so
r? `@compiler-errors`
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 5, 2025
…alfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example rust-lang#110021 (comment) and rust-lang#143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143410 - scottmcm:redo-transmute-again, r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@scottmcm@rustbot@rust-log-analyzer@petrochenkov@compiler-errors@bors@WaffleLapkin