<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 - msan: hoist value checks as much as possible"
   href="https://bugs.llvm.org/show_bug.cgi?id=37670">37670</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>msan: hoist value checks as much as possible
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dvyukov@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently msan places checks as late as possible, e.g. at branch on a bool
value. In some cases this makes it very hard to understand where the actual
uninit-ness come from.

Consider:

void foo(struct p *p)
{
        if (p->x == p->y &&     // msan points here
                p->w == p->z)   // however it would be more useful to point
here
                printf("x\n");
}

or:

int main()
{
        volatile int l;
        x = l;
        p = malloc(1);
        void *r = get();
        if (r)    // with -O2 msan points here
                printf("x\n");
        return 0;
}

volatile int x;
void* p;

void *get()
{
        int y = x / 16;   // but ideally it would point here, so that it's
clear that it's x the bad guy
        if (!y)
                return 0;
        return p;
}</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>