<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:nemanja.i.ibm@gmail.com" title="Nemanja Ivanovic <nemanja.i.ibm@gmail.com>"> <span class="fn">Nemanja Ivanovic</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - unexpected codegen for inline asm"
   href="https://bugs.llvm.org/show_bug.cgi?id=42762">bug 42762</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;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - unexpected codegen for inline asm"
   href="https://bugs.llvm.org/show_bug.cgi?id=42762#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - unexpected codegen for inline asm"
   href="https://bugs.llvm.org/show_bug.cgi?id=42762">bug 42762</a>
              from <span class="vcard"><a class="email" href="mailto:nemanja.i.ibm@gmail.com" title="Nemanja Ivanovic <nemanja.i.ibm@gmail.com>"> <span class="fn">Nemanja Ivanovic</span></a>
</span></b>
        <pre>Proposed fix in <a href="https://reviews.llvm.org/D77542">https://reviews.llvm.org/D77542</a>

Please note that this won't give you optimal codegen. Namely, we will always
use zero as the index and compute the address into the base register. However,
it will at least generate correct code.

We can revisit optimizing codegen in the future. In the meantime, you could
change something like:
void dcbz_w_offset(void* addr, int offset)
{
    asm volatile ("dcbz %y0" :: "Z"(*(unsigned char*)(addr + offset)) :
"memory");
}

into:
void dcbz_w_offset(void* addr, int offset)
{
  asm volatile ("dcbz %1, %0" :: "b"((unsigned char*)addr), "r"(offset) :
"memory");
}</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>