<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [AArch64] Clang incorrectly warns with %wX register constraints"
   href="http://llvm.org/bugs/show_bug.cgi?id=21270">21270</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AArch64] Clang incorrectly warns with %wX register constraints
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>james.molloy@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>