]> granicus.if.org Git - clang/commitdiff
Rephrase asm_mismatched_size_modifier diagnostic. <rdar://problem/14050339>
authorBob Wilson <bob.wilson@apple.com>
Tue, 4 Jun 2013 06:10:09 +0000 (06:10 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 4 Jun 2013 06:10:09 +0000 (06:10 +0000)
The text of this diagnostic was unnecessarily specific to the current ARM
implementation of validateConstraintModifier, and it gave a potentially
confusing suggestion for fixing the problem. The ARM-specific issue is not
a big deal since that is the only target that currently does any checking of
asm operand modifiers, but until my change in 183172 it was still wrong for
output operands in the way that it referred to the value being truncated when
put into a register, since output operands are retrieved from the registers
instead of being put into them. The bigger problem is that its suggestion to
"use a modifier" is wrong and confusing in the case where a "q" modifier is
incorrectly used with an "r" constraint. In that case, the solution might
well be to remove the modifier or perhaps change the constraint. It's better
to just leave the diagnostic message more generic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183209 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/CodeGen/arm-asm-diag.c
test/CodeGen/arm-asm-warn.c

index d49457b1a5cf15294f8f6fe2e00fef0eb3dae87b..a97e1cc35558f1fcc7f046549584175528b12b04 100644 (file)
@@ -5496,8 +5496,8 @@ let CategoryName = "Inline Assembly Issue" in {
     "accepted due to -fheinous-gnu-extensions, but clang may remove support "
     "for this in the future">;
   def warn_asm_mismatched_size_modifier : Warning<
-    "the value is truncated when put into register, "
-    "use a modifier to specify the size">,
+    "value size does not match register size specified by the constraint "
+    "and modifier">,
     InGroup<ASMOperandWidths>;
 }
 
index eea7920b106230e3d4e1a753ca36141310a91d46..bbf916d463354d7980ab5f92b75205e2a4d7a388 100644 (file)
@@ -9,10 +9,10 @@ typedef struct int64x2x4_t {
 int64x2x4_t t1(const long long a[]) {
   int64x2x4_t r;
   __asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
-          : [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r3] "=r"(r.val[3])  // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
+          : [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r3] "=r"(r.val[3])  // expected-warning {{value size does not match register size specified by the constraint and modifier}}
           : [a] "r"(a));
   return r;
 }
index dbcbb38a7498876ad291bcfc9c473236cf283fbc..6112b19d28c00e986032d92515359f21e72a8fae 100644 (file)
@@ -23,10 +23,10 @@ typedef struct int64x2x4_t {
 int64x2x4_t t2(const long long a[]) {
   int64x2x4_t r;
   __asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }"
-          : [r0] "=r"(r.val[0]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r1] "=r"(r.val[1]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r2] "=r"(r.val[2]), // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
-            [r3] "=r"(r.val[3])  // expected-warning {{the value is truncated when put into register, use a modifier to specify the size}}
+          : [r0] "=r"(r.val[0]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r1] "=r"(r.val[1]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r2] "=r"(r.val[2]), // expected-warning {{value size does not match register size specified by the constraint and modifier}}
+            [r3] "=r"(r.val[3])  // expected-warning {{value size does not match register size specified by the constraint and modifier}}
           : [a] "r"(a));
   return r;
 }