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

            Bug ID: 46418
           Summary: Sanitizers don't work with ThinLTO and new pass
                    manager at opt level > 0
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: tomasz.mia...@gmail.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    yuanfang.c...@sony.com
                CC: yuanfang.c...@sony.com

When using ThinLTO and -fexperimental-new-pass-manager at optimization 
level > 0, sanitizer passes are registered using
registerOptimizerLastEPCallback
but the pre-link pipeline constructed with buildThinLTOPreLinkDefaultPipeline
doesn't include optimization pipeline and those callbacks are never invoked.
Thus the sanitizer instrumentation is not performed at all.

Example:

$ cat a.cpp
#include <string.h>
int main(int argc, char **argv) {
  char x[10];
  memset(x, 0, 10);
  int res = x[argc * 10];
  return res;
}
$ clang -fexperimental-new-pass-manager -flto=thin -fsanitize=address -O1 a.cpp
$ ./a.out
$ # No error report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to