-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: "to_immediate: expected Operand::Immediate, got Indirect" #54541
Comments
Does this mean that you do not see the error on stable? Are you able to provide a test case? |
Sorry, I hadn't tested yet with stable. I just did, and with stable (rustc 1.29.0 (aa3ca19 2018-09-11) running on armv7-unknown-linux-gnueabihf) it also crashes, but now giving a different compiler error:
Do you have any pointers on how I can efficiently find out where in my code I have to look to isolate the offending code? I have no idea how to figure out a test case, as the crate contains a lot of code. |
Can you confirm that an older compiler version still works and successfully compiles your code? |
I believe it was caused by this change, as ad2de8b#diff-9e103702275cbef342c2decd3395bf3bR578 CC @RalfJung |
|
I am afraid it is very hard to do anything without a way to reproduce the problem. It would be great if you could attempt to remove module by module from your crate to isolate the issue. @jerous86 the backtrace is unfortunately not very useful because it lacks line numbers. Could you compile rustc on your machine, with |
@estebank Given #54541 (comment) I think the issue is older than that. It seems it already triggered rust/src/librustc_mir/transform/const_prop.rs Line 619 in aa3ca19
That is really old so I do not know how this even worked with 1.28. |
I tried building the rust compiler, but kept on running into issues, and unfortunately don't have the time to figure it all out, just to enable the debuginfo-lines, so I am going to wait until it is enabled by default (I hope #54459 is going to get merged soon?) I will try to figure out a minimal scenario, but it might take a while ... |
I have found that the following scenario reproduces the ICE:
When replacing "One=1" with "One=0" it compiles without error. |
I believe it's the same underlying issue as #55772. |
That seems likely. |
Prevent ICE in const-prop array oob check fixes rust-lang#55772 fixes rust-lang#54541
I'm trying to compile a personal project, but the compiler crashes with the following message:
error: internal compiler error: librustc_mir/interpret/operand.rs:129: to_immediate: expected Operand::Immediate, got Indirect(MemPlace { ptr: Ptr(Pointer { alloc_id: AllocId(14642), offset: Size { raw: 0 } }), align: Align { abi_pow2: 2, pref_pow2: 2 }, extra: None })
I have no idea how to isolate the code that triggers this compiler error, as it's a medium-sized project. Last time I compiled it (and then it compiled successfully) was around beginning of June.
I have the error with nightly and beta.
Meta
Notes from cargo:
Backtrace of
RUST_BACKTRACE=1 cargo build --release
The text was updated successfully, but these errors were encountered: