nvptx abi adjustment may keep PassMode::Direct for small aggregates in conv extern "C"
#117480
Open
Description
opened on Nov 1, 2023
@kjetilkjeka I had to disable this test on nvptx64 since the `extern "C"` ABI uses `Direct` pass mode in invalid ways. I think that's caused by this code:
rust/compiler/rustc_target/src/abi/call/nvptx64.rs
Lines 10 to 14 in b75b3b3
That's invalid since it doesn't say what to do for smaller aggregates, and they default to the (bad) Direct
. Instead you have to say which register they are supposed to be passed in. You can check what the other targets are doing. Targets are expected to set an explicit pass mode for all aggregate arguments.
This should be easy to reproduce by having a function like
#[repr(C)]
struct ReprC1<T: ?Sized>(T);
extern "C" fn myfn(x: ReprC1<i32>) {}
which will likely ICE on the current compiler already.
Originally posted by @RalfJung in #117351 (comment)
Activity