<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Incorrect warning about uninitialized variable with `asm`"
   href="https://llvm.org/bugs/show_bug.cgi?id=31787">bug 31787</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;">CC</td>
           <td>
                
           </td>
           <td>rnk@google.com
           </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 - Incorrect warning about uninitialized variable with `asm`"
   href="https://llvm.org/bugs/show_bug.cgi?id=31787#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Incorrect warning about uninitialized variable with `asm`"
   href="https://llvm.org/bugs/show_bug.cgi?id=31787">bug 31787</a>
              from <span class="vcard"><a class="email" href="mailto:rnk@google.com" title="Reid Kleckner <rnk@google.com>"> <span class="fn">Reid Kleckner</span></a>
</span></b>
        <pre>The warning is correct in our model. This code has undefined behavior. Clang's
register variables do not really give you access to the underlying register.
They only add implicit input and output operands to every fragment of inline
asm in your function.

Here's an example showing what clang does:

$ echo 'void *f() { register void *got asm("%ebx"); return got; }' | clang -cc1
-x c - -O1 -S
        .text
        .def     f;
        .scl    2;
        .type   32;
        .endef
        .globl  f
        .p2align        4, 0x90
f:
        retq

I think there's already a bug somewhere about changing the behavior to be more
like GCC, but the consensus is that we won't implement register variables,
global or local.</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>