HomeFreeBSD

Reapply r230021, r276851 and a few other commits to compiler-rt

Description

Reapply r230021, r276851 and a few other commits to compiler-rt

Reapply r230021 (by ed):

Add a workaround to prevent endless recursion in compiler-rt.

SPARC and MIPS CPUs don't have special instructions to count
leading/trailing zeroes. The compiler-rt library provides fallback
rountines for these. The 64-bit routines, clzdi2 and ctzdi2, are
implemented as simple wrappers around the compiler built-in
builtin_clz(), assuming these will expand to either 32-bit
CPU instructions or calls to
clzsi2 and __ctzsi2.

Unfortunately, our GCC 4.2 probably thinks that because the operand is
stored in a 64-bit register, it might just be a better idea to invoke
its 64-bit equivalent, simply resulting into endless recursion. Fix this
by defining builtin_clz and builtin_ctz to clzsi2 and ctzsi2
explicitly.

Reapply r276851:

Update compiler-rt to trunk r224034. This brings a number of new
builtins, and also the various sanitizers. Support for these will be
added in a later commit.

(cherry picked from commit 71daeec70a15871cfc0071321cd1e819399aa911)

Details

Provenance
dimAuthored on Aug 2 2020, 6:07 PM
Parents
rGe10324587a6a: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Branches
Unknown
Tags
Unknown