-
Notifications
You must be signed in to change notification settings - Fork 13k
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
powerpc64 nightly: discriminant value 0isize
already exists
#39331
Comments
Probably yet another case of i128 fallout. I can’t even begin guessing where the problem is given that the compiler did just fine compiling stage0. May be trans? This for example? |
I also see this with s390x, but the exact same configuration works fine on powerpc64le and x86_64, so that hints that this may be an endianness issue. I'm not sure how that would come up for enum discriminants though. It also works fine on powerpc64 if I use the latest beta ( |
@nagisa So that's:
Calling:
That looks like a pretty good hunch, if LLVM is expecting little-endian |
@cuviper Could you try compiling the compiler with the pub fn C_big_integral(t: Type, u: u128, sign_extend: bool) -> ValueRef {
if ::std::mem::size_of::<u128>() == 16 {
unsafe {
let words = [u as u64, u.wrapping_shr(64) as u64];
llvm::LLVMConstIntOfArbitraryPrecision(t.to_ref(), 2, words.as_ptr())
}
} else {
// SNAP: remove after snapshot
C_integral(t, u as u64, sign_extend)
}
} Also if you hop onto IRC, we could organise a “low” latency debugging session :) |
On IRC, @nagisa suggested running this test command with the patch above:
Now, the patch doesn't directly help me when bootstrapping with the nightly stage0, because that cross-compiled rustc still has the bug. But I can run that test after bootstrapping with the beta stage0, where the build had looked like it succeeded, and indeed
on this part in particular: let z: i128 = 0xABCD_EF;
assert_eq!(z * z, 0x734C_C2F2_A521); And that makes sense -- if With the patched ( |
Now, whether that fix will correct the issue with enum discriminants is harder to tell. The run-pass enum tests are passing for me after beta bootstrap with or without the patch. I think the cross-compiled aspect is probably important to the original problem, so I won't know until I can try with a new nightly stage0. |
Success! Using:
The native rebuild now completes successfully, and also passes the i128 tests. Thanks! |
Using powerpc64 nightly to rebuild itself gets many errors of "discriminant value
0isize
already exists".Using that exact git tree and
./configure --enable-local-rust && make
:The text was updated successfully, but these errors were encountered: