From d8e4142bd442c53b6ddc79ea0dd2d90cf550462e Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Wed, 24 Jan 2018 11:50:10 +0000 Subject: [PATCH] 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). --- src/librustc_trans/asm.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librustc_trans/asm.rs b/src/librustc_trans/asm.rs index c7be0c4e67d71..751f8148a2a90 100644 --- a/src/librustc_trans/asm.rs +++ b/src/librustc_trans/asm.rs @@ -59,8 +59,9 @@ pub fn trans_inline_asm<'a, 'tcx>( // Default per-arch clobbers // Basically what clang does let arch_clobbers = match &bx.sess().target.target.arch[..] { - "x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"], - _ => Vec::new() + "x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"], + "mips" | "mips64" => vec!["~{$1}"], + _ => Vec::new() }; let all_constraints =