[LLVMbugs] [Bug 21270] New: [AArch64] Clang incorrectly warns with %wX register constraints

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Oct 14 04:19:36 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21270

            Bug ID: 21270
           Summary: [AArch64] Clang incorrectly warns with %wX register
                    constraints
           Product: clang
           Version: trunk
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: james.molloy at arm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Hi,

The following function provokes a warning on Clang trunk, 3.5, and AppleClang
based on 3.4:

void g(int one, int two) {
  long wide_two = two;
  asm ("%w0 %1" : "+r" (one), "+r"(wide_two));
}

/Users/jammol01/Code/test.c:3:25: warning: value size does not match register
size specified by the constraint and modifier
      [-Wasm-operand-widths]
  asm ("%w0 %1" : "+r" (one), "+r"(wide_two));
                        ^
/Users/jammol01/Code/test.c:3:13: note: use constraint modifier "w"
  asm ("%w0 %1" : "+r" (one), "+r"(wide_two));
            ^~
            %w1

Obviously this warning is wrong - the second parameter is of type long
(64-bit). This spurious warning is affected by the type of "one" - if I change
"one" to "wide_one" (64-bit extended version) and remove the %w qualifier, it
compiles fine.

Cheers,

James

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141014/83601661/attachment.html>


More information about the llvm-bugs mailing list