<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:renato.golin@linaro.org" title="Renato Golin <renato.golin@linaro.org>"> <span class="fn">Renato Golin</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - aarch64 inline assembly adds number as "#24" instead of plain "24" in the context of .set"
   href="https://llvm.org/bugs/show_bug.cgi?id=27250">bug 27250</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - aarch64 inline assembly adds number as "#24" instead of plain "24" in the context of .set"
   href="https://llvm.org/bugs/show_bug.cgi?id=27250#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - aarch64 inline assembly adds number as "#24" instead of plain "24" in the context of .set"
   href="https://llvm.org/bugs/show_bug.cgi?id=27250">bug 27250</a>
              from <span class="vcard"><a class="email" href="mailto:renato.golin@linaro.org" title="Renato Golin <renato.golin@linaro.org>"> <span class="fn">Renato Golin</span></a>
</span></b>
        <pre>To be clear, what's going on here is that in AArch64, ARM ARM (C1.2), the
assembler is allowed (but not compelled) to not use hashes for immediates,
which is not true for ARMv7 and previous.

Whoever wrote that code abused of a specific behaviour that was not intended
for that kind of inline asm constraint. There is nothing to fix in the
compiler, since the code is not invalid. We just need to find another
constraint code to make it output expressions, rather than immediates.

The proper fix is to change the code to:

void foo () {
  asm(".globl test; .set test, %c0" :: "I"(24));
}

Works on ARM and AArch64, GCC and Clang.

(hat tip to Jim Wilson)</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>