aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-05-04 21:17:57 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2007-05-04 21:17:57 +0200
commit52d53754d17c934708e5d32044bddb6510b40bec (patch)
treec04b42369024dbf54f104e1c586486f789707a54 /gcc
parent134b401077c03424845b4d742aecd8f75e6a8b15 (diff)
downloadgcc-52d53754d17c934708e5d32044bddb6510b40bec.zip
gcc-52d53754d17c934708e5d32044bddb6510b40bec.tar.gz
gcc-52d53754d17c934708e5d32044bddb6510b40bec.tar.bz2
varasm.c (align_variable): Don't increase alignment for DECL_THREAD_LOCAL_P variables above BITS_PER_WORD...
* varasm.c (align_variable): Don't increase alignment for DECL_THREAD_LOCAL_P variables above BITS_PER_WORD through DATA_ALIGNMENT or CONSTANT_ALIGNMENT. From-SVN: r124442
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/varasm.c15
2 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dd4beb2..809f3c8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-04 Jakub Jelinek <jakub@redhat.com>
+
+ * varasm.c (align_variable): Don't increase alignment for
+ DECL_THREAD_LOCAL_P variables above BITS_PER_WORD through
+ DATA_ALIGNMENT or CONSTANT_ALIGNMENT.
+
2007-05-04 Josh Conner <jconner@apple.com>
* basic-block.h (cdi_direction): Assign values to all enumeration
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f8ce726..743c3f1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1097,11 +1097,22 @@ align_variable (tree decl, bool dont_output_data)
if (! DECL_USER_ALIGN (decl))
{
#ifdef DATA_ALIGNMENT
- align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+ unsigned int data_align = DATA_ALIGNMENT (TREE_TYPE (decl), align);
+ /* Don't increase alignment too much for TLS variables - TLS space
+ is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
+ align = data_align;
#endif
#ifdef CONSTANT_ALIGNMENT
if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node)
- align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align);
+ {
+ unsigned int const_align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl),
+ align);
+ /* Don't increase alignment too much for TLS variables - TLS space
+ is too precious. */
+ if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
+ align = const_align;
+ }
#endif
}