<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 - Assembler does not understand symbol used as operand"
   href="https://bugs.llvm.org/show_bug.cgi?id=38945">38945</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assembler does not understand symbol used as operand
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>joel@jms.id.au
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20880" name="attach_20880" title="example">attachment 20880</a> <a href="attachment.cgi?id=20880&action=edit" title="example">[details]</a></span>
example

When building the powerpc Linux kernel, clang trips up on
arch/powerpc/boot/crt0.S:

       cmpdi   r12,RELACOUNT@l

Enclosing the RELACOUNT with () allows it to work. binutils does not require
this, so clang will not work with a bunch of existing code. It would be nice if
clang supported the same syntax.

A simple example, built with clang trunk:

cat << EOF > t.S
NUMBER = 0x6ffffff9

        .text
.globl  main
main:
        cmpwi        8,NUMBER@l
EOF


$ clang-8 -target powerpc64le-linux-gnu t.S 
t.S:6:18: error: unexpected modifier on variable reference
 cmpwi 8,NUMBER@l
                 ^
t.S:6:10: error: unknown operand
 cmpwi 8,NUMBER@l
         ^</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>