For Darwin (and any other emulated TLS targets) we must initialise the
relevant builtins for the two functions that are used by this.
Darwin also needs the "WORD" type to be registered.
gcc/jit/ChangeLog:
* jit-builtins.cc (builtins_manager::make_primitive_type): Register
word type.
(builtins_manager::ensure_optimization_builtins_exist): For targets
without native TLS, register the builtins for the two functions used
by emulated TLS.
Signed-off-by: Iain Sandoe <[email protected]>
---
gcc/jit/jit-builtins.cc | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gcc/jit/jit-builtins.cc b/gcc/jit/jit-builtins.cc
index 539ee132393..4d5cbb4aa41 100644
--- a/gcc/jit/jit-builtins.cc
+++ b/gcc/jit/jit-builtins.cc
@@ -483,7 +483,8 @@ builtins_manager::make_primitive_type (enum
jit_builtin_type type_id)
case BT_UINT32: return m_ctxt->get_int_type (4, false);
case BT_UINT64: return m_ctxt->get_int_type (8, false);
case BT_UINT128: return m_ctxt->get_int_type (16, false);
- // case BT_WORD:
+ case BT_WORD:
+ return m_ctxt->get_int_type (GET_MODE_SIZE (word_mode), false);
// case BT_UNWINDWORD:
case BT_FLOAT: return m_ctxt->get_type (GCC_JIT_TYPE_FLOAT);
case BT_DOUBLE: return m_ctxt->get_type (GCC_JIT_TYPE_DOUBLE);
@@ -620,6 +621,12 @@ builtins_manager::ensure_optimization_builtins_exist ()
(void)get_builtin_function_by_id (BUILT_IN_CTZL);
(void)get_builtin_function_by_id (BUILT_IN_CLZLL);
(void)get_builtin_function_by_id (BUILT_IN_CTZLL);
+ if (!targetm.have_tls)
+ {
+ /* Targets without native TLS may use the emulated model. */
+ (void)get_builtin_function_by_id (BUILT_IN_EMUTLS_GET_ADDRESS);
+ (void)get_builtin_function_by_id (BUILT_IN_EMUTLS_REGISTER_COMMON);
+ }
}
/* Playback support. */
--
2.50.1 (Apple Git-155)