Skip to content

Conversation

@dianqk
Copy link
Member

@dianqk dianqk commented Dec 29, 2025

This is a more principled fix than #147886.
If using a reference at a new location is UB, the reference is not an SSA local borrow. We should only propagate borrows from SSA locals in the SSA-based GVN.

Not ready for reviewing. I haven't resolved all non-SSA borrows.

r? ghost

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[group]Testing stage2 rustc_codegen_cranelift (aarch64-unknown-linux-gnu)
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_cranelift/build_system)
error: rustc interrupted by SIGSEGV, printing backtrace

/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc00598) [0xffeb75400598]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0) [0xffeb7b434850]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x2b25b6c) [0xffeb77325b6c]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RNvXNtCs939VEngBb8A_13rustc_resolve6macrosNtB4_8ResolverNtNtCskSVSgSQQTu4_12rustc_expand4base14ResolverExpand36visit_ast_fragment_with_placeholders+0xb4) [0xffeb7722e900]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x3fd2e84) [0xffeb787d2e84]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RNvMs1_NtCskSVSgSQQTu4_12rustc_expand6expandNtB5_13MacroExpander21fully_expand_fragment+0xdc) [0xffeb787d33d4]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RNvMs1_NtCskSVSgSQQTu4_12rustc_expand6expandNtB5_13MacroExpander12expand_crate+0x34c) [0xffeb787d2430]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xf4c900) [0xffeb7574c900]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RNvNtCs5DsvJT0k02I_15rustc_interface6passes25resolver_for_lowering_raw+0x564) [0xffeb75728dc0]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x33970e4) [0xffeb77b970e4]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x3342360) [0xffeb77b42360]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x32b07c0) [0xffeb77ab07c0]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RINvNtNtCse79jbzFLCMj_18rustc_query_system5query8plumbing17try_execute_queryINtCsgzu6BgXfxQV_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCsk9STtM3mAUt_12rustc_middle5query5erase6ErasedAhj10_EEKb0_KB3t_KB3t_ENtNtB1f_8plumbing9QueryCtxtKB3t_EB1f_+0x368) [0xffeb779eec7c]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x35d7888) [0xffeb77dd7888]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(_RNvMsF_NtNtCsk9STtM3mAUt_12rustc_middle2ty7contextNtB5_6TyCtxt21resolver_for_lowering+0x54) [0xffeb78c1f1d4]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc26e18) [0xffeb75426e18]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xca2010) [0xffeb754a2010]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc79908) [0xffeb75479908]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc458f0) [0xffeb754458f0]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc625c0) [0xffeb754625c0]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc0f0d8) [0xffeb7540f0d8]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc93768) [0xffeb75493768]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc266c4) [0xffeb754266c4]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc8e85c) [0xffeb7548e85c]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0xc1418c) [0xffeb7541418c]
/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/lib/librustc_driver-6f467204be7006a8.so(+0x4d891d0) [0xffeb795891d0]
/lib/aarch64-linux-gnu/libc.so.6(+0x8b9f4) [0xffeb7468b9f4]
/lib/aarch64-linux-gnu/libc.so.6(+0xf6fcc) [0xffeb746f6fcc]

note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
note: backtrace dumped due to SIGSEGV! resuming signal
[RUSTC-TIMING] y test:false 0.234
rustc exited with signal: 11 (SIGSEGV) (core dumped)
error: could not compile `y` (bin "y")

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name y --edition=2021 compiler/rustc_codegen_cranelift/build_system/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("unstable-features"))' -C metadata=511894789d2b1079 -C extra-filename=-7d9e0b2acbb225d5 --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage3-codegen/aarch64-unknown-linux-gnu/release/deps --target aarch64-unknown-linux-gnu -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage3-codegen/aarch64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/aarch64-unknown-linux-gnu/stage3-codegen/release/deps -Csymbol-mangling-version=v0 -Zannotate-moves -Zrandomize-layout -Zunstable-options '--check-cfg=cfg(bootstrap)' -Zmacro-backtrace -Csplit-debuginfo=off -Clink-arg=-L/usr/lib/llvm-20/lib -Cllvm-args=-import-instr-limit=10 -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Alinker-messages -Z binary-dep-depinfo` (exit status: 254)
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo run --target aarch64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --release --manifest-path /checkout/compiler/rustc_codegen_cranelift/build_system/Cargo.toml -- test --download-dir /checkout/obj/build/cg_clif_download --out-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage2-codegen/cg_clif --no-unstable-features --use-backend cranelift --sysroot llvm --skip-test testsuite.extended_sysroot [workdir=/checkout/compiler/rustc_codegen_cranelift]` failed with exit code 101
Created at: src/bootstrap/src/core/build_steps/test.rs:3853:25
Executed at: src/bootstrap/src/core/build_steps/test.rs:3898:26

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:23:24
  local time: Mon Dec 29 14:55:24 UTC 2025
  network time: Mon, 29 Dec 2025 14:55:24 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants