[llvm-bugs] [Bug 37670] New: msan: hoist value checks as much as possible

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 3 22:21:35 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37670

            Bug ID: 37670
           Summary: msan: hoist value checks as much as possible
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: dvyukov at google.com
                CC: llvm-bugs at lists.llvm.org

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;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180604/9f8b5c11/attachment-0001.html>


More information about the llvm-bugs mailing list