Description
I noticed this today, so making this as a reminder, but if you see it and thing it sounds interesting, please pick it up!
Now that #123886 has landed, the general logic for aggregating immediates ought to work for pointers too, but seemingly it doesn't. We should add tests for whatever the problem is, so that it'll be easier for someone to validate a fix.
Steps:
- Delete this block that handles RawPtr specially:
rust/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
Lines 725 to 742 in f9a3fd9
-
Build code to find an ICE. I'm not exactly what code it is, but it might be something related to
crossbeam-utils
. Might work to just./x test --stage 2 tests/codegen
, since it looks like it failed in the stage2 build in my other PR. -
Add minimal code to https://github.com/rust-lang/rust/blob/master/tests/codegen/mir-aggregate-no-alloca.rs that produces the same ICE when running
./x test --stage 1 tests/codegen
. -
Undo the change from step 1 and add basic validation to the codegen test, similar to that done by the other tests in the file.
-
Send a PR with the new tests.
-
(Stretch goal) Delete the block mentioned in step 1 again and fix cg_ssa to pass the new test :D