Auto merge of #45996 - eddyb:even-mirer-1, r=arielb1
MIR: hide .rodata constants vs by-ref ABI clash in trans. Back in #45380, constants were copied into locals during MIR creation to ensure that arguments ' memory can be used by the callee, if the constant is placed in `.rodata` and the ABI passes it by-ref. However, there are several drawbacks (see https://github.com/rust-lang/rust/pull/45380#discussion_r150447709), most importantly the complication of constant propagation (UB if a constant ends up in `Call` arguments) and inconveniencing analyses. Instead, I've modified the `rustc_trans` implementation of calls to copy an `Operand::Constant` argument locally if it's not immediate, and added a test that segfaults without the copy. cc @dotdash @arielb1
Showing
想要评论请 注册 或 登录