aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-01-03 17:19:21 +0100
committerRichard Henderson <rth@gcc.gnu.org>2006-01-03 08:19:21 -0800
commita13e882c791e640f1c53bc8f5a9b142705af650b (patch)
tree3db10c3935e39e5ab5b1657e037fa4a1351ce60a
parent13991abbfce042ef49d546c7d7b63c1c3734fa55 (diff)
downloadgcc-a13e882c791e640f1c53bc8f5a9b142705af650b.zip
gcc-a13e882c791e640f1c53bc8f5a9b142705af650b.tar.gz
gcc-a13e882c791e640f1c53bc8f5a9b142705af650b.tar.bz2
varasm.c (assemble_variable): Handle thread-local COMMON data.
* varasm.c (assemble_variable): Handle thread-local COMMON data. * defaults.h (ASM_OUTPUT_TLS_COMMON): Define. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r109282
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/defaults.h12
-rw-r--r--gcc/varasm.c13
3 files changed, 30 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b0aa2ab..d2e57ce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-03 Jakub Jelinek <jakub@redhat.com>
+ Richard Henderson <rth@redhat.com>
+
+ Merge from gomp-branch:
+ * varasm.c (assemble_variable): Handle thread-local COMMON data.
+ * defaults.h (ASM_OUTPUT_TLS_COMMON): Define.
+
2006-01-03 Paolo Bonzini <bonzini@gnu.org>
PR rtl-optimization/25578
diff --git a/gcc/defaults.h b/gcc/defaults.h
index eb7733d..1207b7b 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -114,6 +114,18 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#endif
#endif
+#if defined (HAVE_AS_TLS) && !defined (ASM_OUTPUT_TLS_COMMON)
+#define ASM_OUTPUT_TLS_COMMON(FILE, DECL, NAME, SIZE) \
+ do \
+ { \
+ fprintf ((FILE), "\t.tls_common\t"); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
+ (SIZE), DECL_ALIGN (DECL) / BITS_PER_UNIT); \
+ } \
+ while (0)
+#endif
+
/* Decide whether to defer emitting the assembler output for an equate
of two values. The default is to not defer output. */
#ifndef TARGET_DEFERRED_OUTPUT_DEFS
diff --git a/gcc/varasm.c b/gcc/varasm.c
index eafba6b..5f58bf4 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1537,11 +1537,20 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
isn't common, and shouldn't be handled as such. */
if (DECL_SECTION_NAME (decl) || dont_output_data)
;
- /* We don't implement common thread-local data at present. */
else if (DECL_THREAD_LOCAL_P (decl))
{
if (DECL_COMMON (decl))
- sorry ("thread-local COMMON data not implemented");
+ {
+#ifdef ASM_OUTPUT_TLS_COMMON
+ unsigned HOST_WIDE_INT size;
+
+ size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
+ ASM_OUTPUT_TLS_COMMON (asm_out_file, decl, name, size);
+ return;
+#else
+ sorry ("thread-local COMMON data not implemented");
+#endif
+ }
}
else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node