<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:vit9696@avp.su" title="vit9696 <vit9696@avp.su>"> <span class="fn">vit9696</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Access to uninitialized volatile stack variable generates warning"
   href="https://bugs.llvm.org/show_bug.cgi?id=50645">bug 50645</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;">CC</td>
           <td>
                
           </td>
           <td>vit9696@avp.su
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Access to uninitialized volatile stack variable generates warning"
   href="https://bugs.llvm.org/show_bug.cgi?id=50645#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Access to uninitialized volatile stack variable generates warning"
   href="https://bugs.llvm.org/show_bug.cgi?id=50645">bug 50645</a>
              from <span class="vcard"><a class="email" href="mailto:vit9696@avp.su" title="vit9696 <vit9696@avp.su>"> <span class="fn">vit9696</span></a>
</span></b>
        <pre>The issue is legit, but the example is a bit too incomplete to properly
understand the problem. What happens inbetween the declaration and the read
operation (and was omitted from the original example) is access made via dma.
I.e. more like this:

uintptr_t get_phys_addr(volatile const void* ptr, size_t sz);
void read_data(uintptr_t addr);

bool test(void)
{
  volatile int var;
  uintptr_t phys = get_phys_addr(&var, sizeof(var));
  read_data(phys);
  return var != 0;
}

It is not correct to drop const from get_phys_addr, as we may want to get one
from a read-only object as well.</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>