[PATCH] [compiler-rt] fix and simplify GetMaxVirtualAddress for ppc64*

Kostya Serebryany kcc at google.com
Fri Oct 31 14:23:43 PDT 2014


I wonder if you can add a powerpc-specific test for this.

================
Comment at: lib/sanitizer_common/sanitizer_posix.cc:91
@@ -90,1 +90,3 @@
+  return
+    (1ULL << (64 - __builtin_clzl((unsigned long)ppc64_frame_address))) - 1;
 # elif defined(__aarch64__)
----------------
I'd prefer if you don't use builtins in this file as it it is compiled by compilers that don't understand it. 
Arguably, such compilers will never have powerpc64 defined, but for consistency still let's still not use builtin here.

There is GET_CURRENT_FRAME in sanitizer_common/sanitizer_internal_defs.h and
MostSignificantSetBitIndex/LeastSignificantSetBitIndex in sanitizer_common/sanitizer_common.h
You probably need MostSignificantSetBitIndex

http://reviews.llvm.org/D6044






More information about the llvm-commits mailing list