[llvm-bugs] [Bug 25550] New: asan conflicts with gvn

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 16 17:49:22 PST 2015


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

            Bug ID: 25550
           Summary: asan conflicts with gvn
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: kcc at google.com
          Reporter: kcc at google.com
                CC: aizatsky at chromium.org, llvm-bugs at lists.llvm.org,
                    stark at mit.edu
    Classification: Unclassified

[initially reported by Greg Stark:
http://lists.llvm.org/pipermail/llvm-dev/2015-November/092484.html]

Reproducer: 
typedef union {
  short q;
  struct {
    short x;
    short y;
    int for_alignment;
  } w;
} U;
int main() {
  char *buf = new char[2];
  buf[0] = buf[1] = 0x0;
  U *u = (U *)buf;
  return  u->q == 0 ? 0 : u->w.y;
}


gvn will speculatively combine two 2-byte loads into one, 
thus moving one of the loads outside of the conditional pass. 

We've seen these problems in the past, and have at least two guards against
those:
lib/Analysis/MemoryDependenceAnalysis.cpp:           
Attribute::SanitizeAddress))
lib/Analysis/ValueTracking.cpp:            Attribute::SanitizeAddress))

but none of these two help here.

-- 
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/20151117/d7a4030e/attachment.html>


More information about the llvm-bugs mailing list