This repository was archived by the owner on May 21, 2019. It is now read-only.
File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 75
75
/* Include internal utility function declarations. */
76
76
#include "int_util.h"
77
77
78
+ /*
79
+ * Workaround for LLVM bug 11663. Prevent endless recursion in
80
+ * __c?zdi2(), where calls to __builtin_c?z() are expanded to
81
+ * __c?zdi2() instead of __c?zsi2().
82
+ *
83
+ * Instead of placing this workaround in c?zdi2.c, put it in this
84
+ * global header to prevent other C files from making the detour
85
+ * through __c?zdi2() as well.
86
+ *
87
+ * This problem has been observed on FreeBSD for sparc64 and
88
+ * mips64 with GCC 4.2.1, and for riscv with GCC 5.2.0.
89
+ * Presumably it's any version of GCC, and targeting an arch that
90
+ * does not have dedicated bit counting instructions.
91
+ */
92
+ #if (defined(__sparc64__ ) || defined(__mips_n64 ) || defined(__mips_o64 ) || defined(__riscv__ ) \
93
+ || (_MIPS_SIM == _ABI64 ) || (_MIPS_SIM == _ABIO64 ))
94
+ si_int __clzsi2 (si_int );
95
+ si_int __ctzsi2 (si_int );
96
+ #define __builtin_clz __clzsi2
97
+ #define __builtin_ctz __ctzsi2
98
+ #endif /* sparc64 || mips_n64 || mips_o64 || riscv */
99
+
78
100
COMPILER_RT_ABI si_int __paritysi2 (si_int a );
79
101
COMPILER_RT_ABI si_int __paritydi2 (di_int a );
80
102
You can’t perform that action at this time.
0 commit comments