From: Bob Wilson Date: Mon, 3 Jun 2013 23:57:13 +0000 (+0000) Subject: Do not report -Wasm-operand-widths for ARM output operands. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=221a8908e4521de533bace49566b5281df9b1924;p=clang Do not report -Wasm-operand-widths for ARM output operands. 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 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 496893885c..baf83c1a14 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -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; diff --git a/test/CodeGen/arm-asm-warn.c b/test/CodeGen/arm-asm-warn.c index 9b52dd695a..dbcbb38a74 100644 --- a/test/CodeGen/arm-asm-warn.c +++ b/test/CodeGen/arm-asm-warn.c @@ -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 } //