Skip to content

Commit d8e4142

Browse files
committed
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).
1 parent fe7e1a4 commit d8e4142

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_trans/asm.rs

+3-2
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)