[gcc r11-1337] gcc: xtensa: make TARGET_HAVE_TLS definition static
Max Filippov
jcmvbkbc@gcc.gnu.org
Mon Jun 15 10:36:48 GMT 2020
https://gcc.gnu.org/g:e46dad5d8f09cd344911e2df428a9d38981c2351
commit r11-1337-ge46dad5d8f09cd344911e2df428a9d38981c2351
Author: Max Filippov <jcmvbkbc@gmail.com>
Date: Sun Jun 14 01:07:01 2020 -0700
gcc: xtensa: make TARGET_HAVE_TLS definition static
Remove TARGET_THREADPTR reference from TARGET_HAVE_TLS to avoid
static data initialization dependency on xtensa core configuration.
2020-06-15 Max Filippov <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/xtensa.c (TARGET_HAVE_TLS): Remove
TARGET_THREADPTR reference.
(xtensa_tls_symbol_p, xtensa_tls_referenced_p): Use
targetm.have_tls instead of TARGET_HAVE_TLS.
(xtensa_option_override): Set targetm.have_tls to false in
configurations without THREADPTR.
Diff:
---
gcc/config/xtensa/xtensa.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index e370aa4623c..be1eb21a0b6 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -275,7 +275,7 @@ static rtx xtensa_delegitimize_address (rtx);
#define TARGET_SECONDARY_RELOAD xtensa_secondary_reload
#undef TARGET_HAVE_TLS
-#define TARGET_HAVE_TLS (TARGET_THREADPTR && HAVE_AS_TLS)
+#define TARGET_HAVE_TLS HAVE_AS_TLS
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM xtensa_cannot_force_const_mem
@@ -602,7 +602,7 @@ constantpool_mem_p (rtx op)
static bool
xtensa_tls_symbol_p (rtx x)
{
- if (! TARGET_HAVE_TLS)
+ if (! targetm.have_tls)
return false;
return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
@@ -2025,7 +2025,7 @@ xtensa_mode_dependent_address_p (const_rtx addr,
bool
xtensa_tls_referenced_p (rtx x)
{
- if (! TARGET_HAVE_TLS)
+ if (! targetm.have_tls)
return false;
subrtx_iterator::array_type array;
@@ -2222,6 +2222,9 @@ xtensa_option_override (void)
if (xtensa_windowed_abi == -1)
xtensa_windowed_abi = TARGET_WINDOWED_ABI_DEFAULT;
+ if (! TARGET_THREADPTR)
+ targetm.have_tls = false;
+
/* Use CONST16 in the absence of L32R.
Set it in the TARGET_OPTION_OVERRIDE to avoid dependency on xtensa
configuration in the xtensa-common.c */
More information about the Gcc-cvs
mailing list