[PATCH] [ASan] Get fake stack code working with GCC 4.8.2.

Jay Foad jay.foad at gmail.com
Fri Nov 14 05:28:50 PST 2014


Hi kcc, samsonov,

In GCC 4.8.2, -fno-builtin is not enough to stop the compiler from
recognizing a memset-like loop and turning it into a call to memset.
You have to add -fno-tree-loop-distribute-patterns.
See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888

On my PowerPC64 box this was causing problems in the fake stack code.
__asan_stack_malloc_4 calls OnMalloc calls SetShadow which has a
memset-like loop. The compiler turned it into a call to memset, which
got intercepted by __asan_memset, which got upset because it was
being called on an address in high shadow memory.

This fixes TestCases/Linux/heavy_uar_test.cc.

http://reviews.llvm.org/D6266

Files:
  CMakeLists.txt
  cmake/config-ix.cmake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6266.16205.patch
Type: text/x-patch
Size: 1306 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141114/e43d774b/attachment.bin>


More information about the llvm-commits mailing list