From e5bc7e38c3c9d75a993435e4dfdcc15644e2262b Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 26 Nov 2024 03:10:22 +0900 Subject: [PATCH] Fix handling of x18 in AArch64 inline assembly on ohos/trusty or with -Zfixed-x18 --- src/inline_asm.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/inline_asm.rs b/src/inline_asm.rs index 7bc500b181478..d74c366a87ffb 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -476,9 +476,14 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { let mut new_slot = |x| new_slot_fn(&mut slot_size, x); // Allocate stack slots for saving clobbered registers - let abi_clobber = InlineAsmClobberAbi::parse(self.arch, &self.tcx.sess.target, sym::C) - .unwrap() - .clobbered_regs(); + let abi_clobber = InlineAsmClobberAbi::parse( + self.arch, + &self.tcx.sess.target, + &self.tcx.sess.unstable_target_features, + sym::C, + ) + .unwrap() + .clobbered_regs(); for (i, reg) in self.registers.iter().enumerate().filter_map(|(i, r)| r.map(|r| (i, r))) { let mut need_save = true; // If the register overlaps with a register clobbered by function call, then