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

            Bug ID: 42479
           Summary: MSan should support asm-goto
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedb...@nondot.org
          Reporter: gli...@google.com
                CC: llvm-bugs@lists.llvm.org

$ cat t.c
#include <stdio.h>
int main() {
  asm goto("jmp %l0" ::::skip_label);
  fprintf(stderr, "Hi!\n");
skip_label:
  fprintf(stderr, "Bye!\n");
  return 0;
}

$ clang t.c -o t -no-integrated-as
$ ./t
Bye!

$ clang t.c -o t -no-integrated-as -fsanitize=memory
clang-9:
/usr/local/google/src/llvm-git-monorepo/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3236:
void {anonymous}::MemorySanitizerVisitor::visitCallSite(llvm::CallSite):
Assertion `(CS.isCall() || CS.isInvoke()) && "Unknown type of CallSite"'
failed.
Stack dump:
0.      Program arguments:
/usr/local/google/src/llvm-git-monorepo/llvm_cmake_build/bin/clang-9 -cc1
-triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name t.c
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -no-integrated-as -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-resource-dir
/usr/local/google/src/llvm-git-monorepo/llvm_cmake_build/lib/clang/9.0.0
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/src/llvm-git-monorepo/llvm_cmake_build/lib/clang/9.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fno-dwarf-directory-asm -fdebug-compilation-dir
/usr/local/google/src/llvm-git-monorepo -ferror-limit 19 -fmessage-length 0
-fsanitize=memory
-fsanitize-blacklist=/usr/local/google/src/llvm-git-monorepo/llvm_cmake_build/lib/clang/9.0.0/share/msan_blacklist.txt
-fsanitize-memory-use-after-dtor -fno-assume-sane-operator-new
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/t-3bc9a0.s -x c t.c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 't.c'.
4.      Running pass 'MemorySanitizerLegacyPass' on function '@main'

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