Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp	(revision 213849)
+++ lib/Basic/Targets.cpp	(working copy)
@@ -4057,7 +4057,8 @@
     return R;
   }
   bool validateConstraintModifier(StringRef Constraint, const char Modifier,
-                                  unsigned Size) const override {
+                                  bool IsSignedInt, unsigned Size,
+                                  std::string &FixitType) const override {
     bool isOutput = (Constraint[0] == '=');
     bool isInOut = (Constraint[0] == '+');
 
@@ -4503,6 +4504,39 @@
     return false;
   }
 
+  virtual bool validateConstraintModifier(StringRef Constraint,
+                                          const char Modifier,
+                                          bool IsSignedInt,
+                                          unsigned Size,
+                                          std::string &FixitType) const {
+    // Strip off constraint modifiers.
+    while (Constraint[0] == '=' || Constraint[0] == '+' || Constraint[0] == '&')
+      Constraint = Constraint.substr(1);
+
+    switch (Constraint[0]) {
+    default:
+      return true;
+    case 'z':
+    case 'r': {
+      switch (Modifier) {
+      case 'x':
+      case 'w':
+        // For now assume that the person knows what they're
+        // doing with the modifier.
+        return true;
+      default:
+        // By default an 'r' constraint will be in the 'x'
+        // registers.
+        if (Size == 64)
+          return true;
+
+        FixitType = IsSignedInt ? "long" : "unsigned long";
+        return false;
+      }
+    }
+    }
+  }
+
   virtual const char *getClobbers() const { return ""; }
 
   int getEHDataRegisterNumber(unsigned RegNo) const {
Index: lib/Sema/SemaStmtAsm.cpp
===================================================================
--- lib/Sema/SemaStmtAsm.cpp	(revision 213849)
+++ lib/Sema/SemaStmtAsm.cpp	(working copy)
@@ -257,11 +257,19 @@
       continue;
 
     unsigned Size = Context.getTypeSize(Ty);
+    std::string FixitType;
     if (!Context.getTargetInfo()
           .validateConstraintModifier(Literal->getString(), Piece.getModifier(),
-                                      Size))
-      Diag(Exprs[ConstraintIdx]->getLocStart(),
-           diag::warn_asm_mismatched_size_modifier);
+                                      Ty->isSignedIntegerType(), Size,
+                                      FixitType)) {
+      auto B = Diag(Exprs[ConstraintIdx]->getLocStart(),
+                    diag::warn_asm_mismatched_size_modifier);
+      if (!FixitType.empty()) {
+          FixitType = "(" + FixitType + ")";
+          B.AddFixItHint(FixItHint::CreateInsertion(
+                           Exprs[ConstraintIdx]->getLocStart(), FixitType));
+      }
+    }
   }
 
   // Validate tied input operands for type mismatches.
Index: test/Sema/arm64-inline-asm.c
===================================================================
--- test/Sema/arm64-inline-asm.c	(revision 213849)
+++ test/Sema/arm64-inline-asm.c	(working copy)
@@ -1,9 +1,9 @@
 // RUN: %clang_cc1 -triple arm64-apple-ios7.1 -fsyntax-only -verify %s
-// expected-no-diagnostics
 
 void foo() {
   asm volatile("USE(%0)" :: "z"(0LL));
   asm volatile("USE(%x0)" :: "z"(0LL));
   asm volatile("USE(%w0)" :: "z"(0));
 
+  asm volatile("USE(%0)" :: "z"(0)); // expected-warning {{value size does not match register size specified by the constraint and modifier}}
 }
Index: test/Sema/inline-asm-validate.c
===================================================================
--- test/Sema/inline-asm-validate.c	(revision 213849)
+++ test/Sema/inline-asm-validate.c	(working copy)
@@ -1,9 +1,8 @@
 // RUN: %clang_cc1 -triple arm64-apple-macosx10.8.0 -fsyntax-only -verify %s
-// expected-no-diagnostics
 
 unsigned t, r, *p;
 
 int foo (void) {
-  __asm__ __volatile__( "stxr   %w[_t], %[_r], [%[_p]]" : [_t] "=&r" (t) : [_p] "p" (p), [_r] "r" (r) : "memory");
+  __asm__ __volatile__( "stxr   %w[_t], %[_r], [%[_p]]" : [_t] "=&r" (t) : [_p] "p" (p), [_r] "r" (r) : "memory"); // expected-warning{{value size does not match register size specified by the constraint and modifier}}
   return 1;
 }
Index: include/clang/Basic/TargetInfo.h
===================================================================
--- include/clang/Basic/TargetInfo.h	(revision 213849)
+++ include/clang/Basic/TargetInfo.h	(working copy)
@@ -583,7 +583,9 @@
   }
   virtual bool validateConstraintModifier(StringRef /*Constraint*/,
                                           const char /*Modifier*/,
-                                          unsigned /*Size*/) const {
+                                          bool /*IsSignedInt*/,
+                                          unsigned /*Size*/,
+                                          std::string &/*FixitType*/) const {
     return true;
   }
   bool resolveSymbolicName(const char *&Name,
