diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2020-06-14 01:07:01 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2020-06-15 03:36:16 -0700 |
commit | e46dad5d8f09cd344911e2df428a9d38981c2351 (patch) | |
tree | b6efedf1be43ac3cb5ef4411e1c99e13025bc75c | |
parent | 8c8eb94914c1afcac014e33def43ce329dfa314e (diff) | |
download | gcc-e46dad5d8f09cd344911e2df428a9d38981c2351.zip gcc-e46dad5d8f09cd344911e2df428a9d38981c2351.tar.gz gcc-e46dad5d8f09cd344911e2df428a9d38981c2351.tar.bz2 |
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.
-rw-r--r-- | gcc/config/xtensa/xtensa.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index e370aa4..be1eb21 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 */ |