Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/compiler_rt/dist/lib/builtins Fix infinite ...
details: https://anonhg.NetBSD.org/src/rev/a5b723c12b30
branches: trunk
changeset: 343925:a5b723c12b30
user: christos <christos%NetBSD.org@localhost>
date: Fri Mar 04 17:49:06 2016 +0000
description:
Fix infinite recursion caused by gcc lossage.
diffstat:
sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c | 6 ++++++
sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diffs (32 lines):
diff -r 5c1bd8d39f19 -r a5b723c12b30 sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c Fri Mar 04 04:18:44 2016 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/clzdi2.c Fri Mar 04 17:49:06 2016 +0000
@@ -16,6 +16,12 @@
/* Returns: the number of leading 0-bits */
+#if !defined(__clang__) && (defined(__sparc64__) || defined(__mips64))
+/* gcc resolves __builtin_clz -> __clzdi2 leading to infinite recursion */
+#define __builtin_clz(a) __clzsi2(a)
+extern si_int __clzsi2(si_int);
+#endif
+
/* Precondition: a != 0 */
COMPILER_RT_ABI si_int
diff -r 5c1bd8d39f19 -r a5b723c12b30 sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c Fri Mar 04 04:18:44 2016 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/ctzdi2.c Fri Mar 04 17:49:06 2016 +0000
@@ -16,6 +16,12 @@
/* Returns: the number of trailing 0-bits */
+#if !defined(__clang__) && (defined(__sparc64__) || defined(__mips64))
+/* gcc resolves __builtin_ctz -> __ctzdi2 leading to infinite recursion */
+#define __builtin_ctz(a) __ctzsi2(a)
+extern si_int __ctzsi2(si_int);
+#endif
+
/* Precondition: a != 0 */
COMPILER_RT_ABI si_int
Home |
Main Index |
Thread Index |
Old Index