<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Assembly parsing error (too many operands for instruction) for ARM Cortex-M"
   href="https://bugs.llvm.org/show_bug.cgi?id=39532">39532</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assembly parsing error (too many operands for instruction) for ARM Cortex-M
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>jsshin@sor.snu.ac.kr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>error encountered when compiling newlib for Cortex-M3 with -Os.

====== ldrb.S ===================
        .text
        .global test
        .type test, %function

        ldrb.w    r2, [r3], #1

        .size test, . - strlen
==================================

Compiling above code with gives error.

$ clang -target arm-none-eabi -mcpu=cortex-m3  -c ldrb.S
ldrb.S:5:19: error: too many operands for instruction
 ldrb.w r2, [r3], #1
                  ^

GCC compiles it without complaining.

Whether or not this behavior is correct is a bit confusing because "A7.7.45
LDRB(immediate)" section of the ARM7-m architecture manual shows that  .W
suffix is applied to T2 encoding but not to T3 encoding (above).
However "A7.2 Standard assembler syntax fields" suggests that .W suffix is used
to force the assembler to select 32-bit encoding. So I think Clang shouldn't
really regard it as an error.</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>