-
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 in sparc64 fn_abi_of_instance
#115399
Comments
Cc @psumbera (based on git blame, not sure who is maintaining the sparc64 target -- it is sadly not documented) |
This also affects the netbsd and openbsd targets. |
FWIW, there are sparc64 machines available at the GCC Compile Farm which can be used for testing. See: https://gcc.gnu.org/wiki/CompileFarm The sparc64 Linux machines are currently offline but are expected to return shortly. |
I think I see the same on Solaris SPARC. The first bad version is 1.74. Version 1.73 seems to work. |
It is possible that this did not ICE before #115277. However, that just means that the latent bug in the sparc ABI handling was hidden by the way our layout code chose to order zero-sized fields. We have no invariant on layouts saying that zero-sized fields can only occur at the beginning, so the bug needs to be fixed in sparc ABI adjustments. |
In particular, here it is walking the fields in source declaration order:
However, source order can be different from layout order. So this will not visit the fields in increasing order of offsets! Maybe that's a problem, maybe it isn't. Unfortunately the ABI code has a bunch of very arbitrary-looking logic and basically no comments. ( |
Do you think you can provide some example code which would demonstrate this SPARC64 ABI zero-sized fields issue? Right now I'm lost. I think I need something to play with. (And yes. Someone with both Rust internals and SPARC64 ABI knowledge would be great to have here.) |
The issue description contains an example that ICEs. It involves a zero-sized type, |
@RalfJung How can I access "layout order"? (My current pull requests works for this case. But not for commented out tests because of #115336. So I need to look at it further.) |
The |
I tried the following code:
Building this for the sparc64-unknown-linux-gnu target causes an ICE:
(I used Miri for this because I don't have cross-builds set up for that target, but I'm fairly sure the ICE would also happen with a regular rustc build.)
I am fairly sure that it is this subtraction that is overflowing:
rust/compiler/rustc_target/src/abi/call/sparc64.rs
Line 187 in 1bd0430
How do I find out who's maintaining that target so that I can ping the right people?
The text was updated successfully, but these errors were encountered: