-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Using -C codegen_units=N
while bootstrapping rust generates an LLVM assertion
#19826
Comments
I can reproduce this. Backtrace:
|
We're hitting this on builds of rustc now, that makes me very, very sad. @nikomatsakis is this the same bug you were hitting earlier? Did you get much of a handle on it? @epdtry If you have any spare cycles over the Christmas break, we would appreciate a fix :-) |
Managed to get a reduced test case (~100 lines). Check this gist for details. |
Here's an updated gist that ICEs on https://gist.github.com/tomjakubowski/9c49af9cd2582c37d0e8/a056ead1b0ba5bd29fae8b709fc031ebdc49e4fd |
To people from the future, I'm going to add notes of my investigation here. It looks like we're getting some oddness with types appearing to be different when using multiple codegen units. Specifically, Rust is trying to cast an unboxed closure to an identical-looking unboxed closure. |
Don't know how related, but the same error comes with this, too (on linux and with no flags to rustc): fn main() {
let a: [u8; 2] = [97, 98];
//if &a[0..2] == b"ab" { // works
if a[0..2] == *b"ab" { // ICE
println!("test");
}
} (rustc 1.0.0-nightly (f4f10db 2015-01-17 20:31:08 +0000)) |
Triage: @lgvz's code no longer produces an error. @tomjakubowski/@japaric's gist no longer compiles. |
Closes #19826 r? @nikomatsakis There is still some work to do until parallel codegen is perfect - we don't pass make check due to missing the symbol for registering a macro. But we do bootstrap with codegen_units=4 and pass make check without codegen_units, so I think it should land. For the curious, make rustc-stage2 -j8: ``` codegen_units=1: real 9m18.074s user 11m59.858s sys 0m13.281s codegen_units=4: real 6m3.672s user 13m5.474s sys 0m12.146s ``` Which is a 33% speedup :-)
Closes #19826 r? @nikomatsakis There is still some work to do until parallel codegen is perfect - we don't pass make check due to missing the symbol for registering a macro. But we do bootstrap with codegen_units=4 and pass make check without codegen_units, so I think it should land. For the curious, make rustc-stage2 -j8: ``` codegen_units=1: real 9m18.074s user 11m59.858s sys 0m13.281s codegen_units=4: real 6m3.672s user 13m5.474s sys 0m12.146s ``` Which is a 33% speedup :-)
STR
Version
444fa1b
Sadly, I couldn't generate a minimal script that reproduces the problem. But these seem to be the required ingredients:
#[inline]
d function in the root crate.-C codegen_units
flag.cc @nikomatsakis @nick29581
The text was updated successfully, but these errors were encountered: