diff options
author | David Edelsohn <dje.gcc@gmail.com> | 2021-04-07 21:34:02 -0400 |
---|---|---|
committer | David Edelsohn <dje.gcc@gmail.com> | 2021-04-08 17:40:23 -0400 |
commit | 5f7c2d20b5bd33d7afacb56e18111edb3256c903 (patch) | |
tree | 1a97142946c9e9c88f59a376ff921bf21737362d | |
parent | b5242b284549cc7994a8dc073f9e1479ee0ae915 (diff) | |
download | gcc-5f7c2d20b5bd33d7afacb56e18111edb3256c903.zip gcc-5f7c2d20b5bd33d7afacb56e18111edb3256c903.tar.gz gcc-5f7c2d20b5bd33d7afacb56e18111edb3256c903.tar.bz2 |
aix: revert TLS common change
GCC uses TLS common for both public common / BSS and local common / BSS.
This patch reverts to use .comm directive to allocate TLS
common / BSS. This also changes the priority of section selection
to use BSS before data section.
gcc/ChangeLog:
* config/rs6000/rs6000.c (rs6000_xcoff_select_section): Select
TLS BSS before TLS data.
* config/rs6000/xcoff.h (ASM_OUTPUT_TLS_COMMON): Use .comm.
gcc/testsuite/ChangeLog:
* g++.dg/gomp/tls-5.C: Expect tbss failure on AIX.
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/xcoff.h | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/tls-5.C | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 35f5c33..48b8efd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21285,14 +21285,14 @@ rs6000_xcoff_select_section (tree decl, int reloc, #if HAVE_AS_TLS if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)) { - if (TREE_PUBLIC (decl)) - return tls_data_section; - else if (bss_initializer_p (decl)) + if (bss_initializer_p (decl)) { /* Convert to COMMON to emit in BSS. */ DECL_COMMON (decl) = 1; return tls_comm_section; } + else if (TREE_PUBLIC (decl)) + return tls_data_section; else return tls_private_data_section; } diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h index cb9aae7..c016678 100644 --- a/gcc/config/rs6000/xcoff.h +++ b/gcc/config/rs6000/xcoff.h @@ -255,11 +255,11 @@ } while (0) #ifdef HAVE_AS_TLS -#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \ - do { fputs (LOCAL_COMMON_ASM_OP, (FILE)); \ - fprintf ((FILE), "%s," HOST_WIDE_INT_PRINT_UNSIGNED",%s[UL],3\n", \ - (*targetm.strip_name_encoding) (NAME), (SIZE), \ - (*targetm.strip_name_encoding) (NAME)); \ +#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \ + do { fputs (COMMON_ASM_OP, (FILE)); \ + RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \ + fprintf ((FILE), "[UL]," HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ + (SIZE)); \ } while (0) #endif diff --git a/gcc/testsuite/g++.dg/gomp/tls-5.C b/gcc/testsuite/g++.dg/gomp/tls-5.C index eb187b6..81431e8 100644 --- a/gcc/testsuite/g++.dg/gomp/tls-5.C +++ b/gcc/testsuite/g++.dg/gomp/tls-5.C @@ -1,7 +1,7 @@ // The reference temp should be TLS, not normal data. // { dg-require-effective-target c++11 } // { dg-final { scan-assembler-not "\\.data" { target tls_native xfail powerpc-*-aix* } } } -// { dg-final { scan-assembler-symbol-section {^_?ir$} {^\.tbss|\[TL\]} { target tls_native } } } +// { dg-final { scan-assembler-symbol-section {^_?ir$} {^\.tbss} { target tls_native xfail powerpc-*-aix* } } } // { dg-final { scan-assembler-symbol-section {^_?_ZGR2ir_$} {^\.tdata|\[TL\]} { target tls_native } } } extern int&& ir; |