]> git.lizzy.rs Git - rust.git/commitdiff
rustc_trans: clobber $1 (aka $at) on mips
authorJames Cowgill <jcowgill@debian.org>
Wed, 24 Jan 2018 11:50:10 +0000 (11:50 +0000)
committerJames Cowgill <jcowgill@debian.org>
Tue, 30 Jan 2018 11:54:52 +0000 (11:54 +0000)
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

index c7be0c4e67d712a3617e9a16f5884f23314dbedd..751f8148a2a9086fde59c055a8b22d83890e6ef3 100644 (file)
@@ -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 =