[PATCH] D81631: Fix undefined behavior in Dwarf.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 18:03:41 PDT 2020


dblaikie added a comment.

In D81631#2102343 <https://reviews.llvm.org/D81631#2102343>, @linzj wrote:

> In D81631#2101784 <https://reviews.llvm.org/D81631#2101784>, @dblaikie wrote:
>
> > Could you include a comment in the test case explaining how this IR differs from all the IR clang usually generates? (in general what's interesting about this IR)
> >
> > Also - remove the "valgrind" usage from that llc invocation (test machines might not have valgrind, etc - does UBSan/ASan/MSan catch this? There are buildbots that'll run the tests with sanitizers like those enabled & it'd be good if the test could catch a regression at least on those buildbots) - and include some testing of the behavior of llc (ie: what behavior do we get instead of UB? Presumably there's some specific behavior we're expecting beyond "anything other than crashing")
>
>
> This simple function is int add(int a,  int b) { return a + b ;}


Oh - hmm. I don't seem to reproduce this myself with "clang++ ^.cc -g -c -O3" running under valgrind. Is there something else I should be doing to reproduce/validate this?

> How can I build a LLC with ubsan?  I want to test in my local machine.

I believe you set the CMake variable:  LLVM_USE_SANITIZER=Undefined


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81631/new/

https://reviews.llvm.org/D81631





More information about the llvm-commits mailing list