codegen: handle OperandValue::Uninit in codegen_return_terminator#159825
Conversation
|
r? @tiif rustbot has assigned @tiif. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
r? @oli-obk |
This comment has been minimized.
This comment has been minimized.
| let op = self.codegen_consume(bx, mir::Place::return_place().as_ref()); | ||
| if let Ref(place_val) = op.val { | ||
| bx.load_from_place(bx.backend_type(op.layout), place_val) | ||
| } else if let Uninit = op.val { |
There was a problem hiding this comment.
Use an exhaustive match instead of an if let chain
|
Reminder, once the PR becomes ready for a review, use |
When adding `OperandValue::Uninit` to skip stores for entirely-uninit constants, we missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
|
@rustbot ready |
|
@bors r+ rollup |
|
@bors p=1 (Since we're getting a non-trivial number of reports of this.) |
codegen: handle OperandValue::Uninit in codegen_return_terminator Fixes rust-lang#159815. rust-lang#157797 added `OperandValue::Uninit` to skip stores for entirely-uninit constants, but missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
codegen: handle OperandValue::Uninit in codegen_return_terminator Fixes #159815. #157797 added `OperandValue::Uninit` to skip stores for entirely-uninit constants, but missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
This comment has been minimized.
This comment has been minimized.
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159825. |
This comment has been minimized.
This comment has been minimized.
codegen: handle OperandValue::Uninit in codegen_return_terminator Fixes #159815. #157797 added `OperandValue::Uninit` to skip stores for entirely-uninit constants, but missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159920. |
This comment has been minimized.
This comment has been minimized.
codegen: handle OperandValue::Uninit in codegen_return_terminator Fixes #159815. #157797 added `OperandValue::Uninit` to skip stores for entirely-uninit constants, but missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159920. |
codegen: handle OperandValue::Uninit in codegen_return_terminator Fixes rust-lang#159815. rust-lang#157797 added `OperandValue::Uninit` to skip stores for entirely-uninit constants, but missed the `PassMode::Direct | PassMode::Pair` branch of `codegen_return_terminator`, which called `immediate_or_packed_pair` unconditionally. A function directly returning an all-uninit value (e.g. `MaybeUninit::uninit()`) would hit that branch and ICE in `OperandRef::immediate`, as reported against tokio and reduced by tmiasko.
…uwer Rollup of 25 pull requests Successful merges: - #159825 (codegen: handle OperandValue::Uninit in codegen_return_terminator) - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
…uwer Rollup of 25 pull requests Successful merges: - #159825 (codegen: handle OperandValue::Uninit in codegen_return_terminator) - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
|
@bors p=101 |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 008fa22 (parent) -> fdbd8ee (this PR) Test differencesShow 6 test diffsStage 1
Stage 2
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fdbd8ee70d9b68d98be873e1095d74cf9441f0c8 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (fdbd8ee): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 1.9%, secondary -2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.346s -> 487.865s (-0.30%) |
The ICE was already reported as rust-lang/rust#159815 and fixed by rust-lang/rust#159825, merged 2026-07-26 06:29 UTC — after the nightly that broke us was cut, so 2026-07-27 is the first nightly containing it. Record that in the pin comment, along with what to check before unpinning, so the pin does not outlive its cause. rust-lang/rust#159867 is a still-open ICE in the same `OperandValue::Uninit` family, so the unpin wants verifying rather than assuming. Co-Authored-By: Claude Opus 5 <[email protected]>
The ICE was already reported as rust-lang/rust#159815 and fixed by rust-lang/rust#159825, merged 2026-07-26 06:29 UTC — after the nightly that broke us was cut, so 2026-07-27 is the first nightly containing it. Record that in the pin comment, along with what to check before unpinning, so the pin does not outlive its cause. rust-lang/rust#159867 is a still-open ICE in the same `OperandValue::Uninit` family, so the unpin wants verifying rather than assuming. Co-Authored-By: Claude Opus 5 <[email protected]>
View all comments
Fixes #159815.
#157797 added
OperandValue::Uninitto skip stores for entirely-uninit constants, but missed thePassMode::Direct | PassMode::Pairbranch ofcodegen_return_terminator, which calledimmediate_or_packed_pairunconditionally. A function directly returning an all-uninit value (e.g.MaybeUninit::uninit()) would hit that branch and ICE inOperandRef::immediate, as reported against tokio and reduced by tmiasko.