Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --I tried this code: code originally from <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: When compile with , there is a which does not occur with `
Due to inlining of :
does the no_mangle attr have done kind of effect? can't check on mobile right now
I think it's more likely the struct's being ignored when performing that field access. cc
A slightly simplified example: It only arises when inlining a generic function (in this case ) that bitcasts a .
The difference seems to be that bitcasts a pointer to a vector, while the inlined bitcasts a vector directly. I suspect that the extra move that happens when is inlined causes vector value to be stored behind a pointer. I can reproduce the crash using just to force an extra move. As for why puts the vector behind a pointer, the default rust abi passes vector types by-ref to ensure that changing target features doesn't change the abi.
With that crashes at and without it gives the following LLVM ir:
It's interesting that the failure (in my example) required to be generic—that shouldn't affect the ABI of the monomorphized function, should it?
Indeed. It shouldn't affect the ABI.
The original no longer crashes since , but still does
Triage: The above mentioned example now compiles fine with the latest nightly, I guess is related. Marking as .

Discussion:
} fn update_pass_mode(&mut self, ln: &str, revision: Option<&str>, config: &Config) { <del> let check_no_run = |s| { if config.mode != Mode::Ui && config.mode != Mode::Incremental { panic!("`{}` header is only supported in UI and incremental tests", s); } if config.mode == Mode::Incremental && !revision.map_or(false, |r| r.starts_with("cfail")) && !self.revisions.iter().all(|r| r.starts_with("cfail")) { panic!("`{}` header is only supported in `cfail` incremental tests", s); </del> <ins> let check_no_run = |s| match (config.mode, s) { (Mode::Ui, _) => (), (Mode::Codegen, "build-pass") => (), (Mode::Incremental, _) => { if revision.is_some() && !self.revisions.iter().all(|r| r.starts_with("cfail")) { panic!("`{s}` header is only supported in `cfail` incremental tests") } </ins> } <ins> (mode, _) => panic!("`{s}` header is not supported in `{mode}` tests"), </ins> }; let pass_mode = if config.parse_name_directive(ln, "check-pass") { check_no_run("check-pass");

check_no_run("build-pass"); Some(PassMode::Build) } else if config.parse_name_directive(ln, "run-pass") { <del> if config.mode != Mode::Ui { panic!("`run-pass` header is only supported in UI tests") } </del> <ins> check_no_run("run-pass"); </ins> Some(PassMode::Run) } else { None

self.fatal_proc_rec("compilation failed!", &proc_res); } <ins> if let Some(PassMode::Build) = self.pass_mode() { return; } </ins> let output_path = self.output_base_name().with_extension("ll"); let proc_res = self.verify_with_filecheck(&output_path); if !proc_res.status.success() {

<ins> // revisions: llvm mir-opt3 </ins> // compile-flags: -C opt-level=3 -Z merge-functions=disabled --edition=2021 // only-x86_64 // ignore-debug: the debug assertions get in the way <ins> // [mir-opt3]compile-flags: -Zmir-opt-level=3 // [mir-opt3]build-pass // mir-opt3 is a regression test for https://github.com/rust-lang/rust/issues/98016 </ins> #![crate_type = "lib"] #![feature(portable_simd)]

#[no_mangle] // CHECK-LABEL: @wider_reduce_into_iter pub fn wider_reduce_into_iter(x: Simd<u8, N>) -> u16 { <del> // FIXME MIR inlining messes up LLVM optimizations. // WOULD-CHECK: zext <8 x i8> // WOULD-CHECK-SAME: to <8 x i16> // WOULD-CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> </del> <ins> // CHECK: zext <8 x i8> // CHECK-SAME: to <8 x i16> // CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16> </ins> x.to_array().into_iter().map(u16::from).sum() }