]> granicus.if.org Git - clang/commitdiff
Do not report -Wasm-operand-widths for ARM output operands. <rdar://14050337>
authorBob Wilson <bob.wilson@apple.com>
Mon, 3 Jun 2013 23:57:13 +0000 (23:57 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 3 Jun 2013 23:57:13 +0000 (23:57 +0000)
We're getting reports of this warning getting triggered in cases where it
is not adding any value. There is no asm operand modifier that you can use
to silence it, and there's really nothing wrong with having an LDRB, for
example, with a "char" output.

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

lib/Basic/Targets.cpp
test/CodeGen/arm-asm-warn.c

index 496893885c688ebf4fc4949b28216498839bcf73..baf83c1a14c6868ad740d92d4a0b2a409590d2ff 100644 (file)
@@ -3897,8 +3897,7 @@ public:
     case 'r': {
       switch (Modifier) {
       default:
-        return isInOut || (isOutput && Size >= 32) ||
-          (!isOutput && !isInOut && Size <= 32);
+        return (isInOut || isOutput || Size <= 32);
       case 'q':
         // A register of size 32 cannot fit a vector type.
         return false;
index 9b52dd695a518ca968bb45c1dad31463cdd9a79d..dbcbb38a7498876ad291bcfc9c473236cf283fbc 100644 (file)
@@ -12,6 +12,7 @@ void t1(int x, char y) {
                    : "+r" (x),
                      "+r" (y)
                    :);
+  __asm__ volatile("ldrb %0, [%1]" : "=r" (y) : "r" (x)); // no warning
 }
 
 // <rdar://problem/12284092>