Skip to content

Commit

Permalink
Fix handling of x18 in AArch64 inline assembly on ohos/trusty or with…
Browse files Browse the repository at this point in the history
… -Zfixed-x18
  • Loading branch information
taiki-e committed Nov 25, 2024
1 parent e73d321 commit e5bc7e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/inline_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5bc7e3

Please sign in to comment.