r183172 - Do not report -Wasm-operand-widths for ARM output operands. <rdar://14050337>

Bob Wilson bob.wilson at apple.com
Mon Jun 3 16:57:13 PDT 2013


Author: bwilson
Date: Mon Jun  3 18:57:13 2013
New Revision: 183172

URL: http://llvm.org/viewvc/llvm-project?rev=183172&view=rev
Log:
Do not report -Wasm-operand-widths for ARM output operands. <rdar://14050337>

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.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/CodeGen/arm-asm-warn.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=183172&r1=183171&r2=183172&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Jun  3 18:57:13 2013
@@ -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;

Modified: cfe/trunk/test/CodeGen/arm-asm-warn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-asm-warn.c?rev=183172&r1=183171&r2=183172&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/arm-asm-warn.c (original)
+++ cfe/trunk/test/CodeGen/arm-asm-warn.c Mon Jun  3 18:57:13 2013
@@ -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>





More information about the cfe-commits mailing list