Skip to content

Commit 6c0d5f5

Browse files
authored
Rollup merge of rust-lang#47875 - jcowgill:mips-clobber-at, r=rkruppe
rustc_trans: clobber $1 (aka $at) on mips This copies what clang does. There is a long explanation as to why this is needed in the clang source (tools/clang/lib/Basic/Targets/Mips.h).
2 parents 33d175f + d8e4142 commit 6c0d5f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_trans/asm.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ pub fn trans_inline_asm<'a, 'tcx>(
5959
// Default per-arch clobbers
6060
// Basically what clang does
6161
let arch_clobbers = match &bx.sess().target.target.arch[..] {
62-
"x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"],
63-
_ => Vec::new()
62+
"x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"],
63+
"mips" | "mips64" => vec!["~{$1}"],
64+
_ => Vec::new()
6465
};
6566

6667
let all_constraints =

0 commit comments

Comments
 (0)