Skip to content

Commit

Permalink
Rollup merge of rust-lang#47875 - jcowgill:mips-clobber-at, r=rkruppe
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
kennytm committed Jan 31, 2018
2 parents 33d175f + d8e4142 commit 6c0d5f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_trans/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 6c0d5f5

Please sign in to comment.