]> gcc.gnu.org Git - gcc.git/commitdiff
varasm.c (align_variable): Don't increase alignment for DECL_THREAD_LOCAL_P variables...
authorJakub Jelinek <jakub@redhat.com>
Fri, 4 May 2007 19:17:57 +0000 (21:17 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 4 May 2007 19:17:57 +0000 (21:17 +0200)
* 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

gcc/ChangeLog
gcc/varasm.c

index dd4beb2ad42474040257ab19026176aabf3b6a30..809f3c85442373662981ca7c92fcff3124f51cc0 100644 (file)
@@ -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
index f8ce7263065013f5a5cf5ee3f9c10b894eb6b50b..743c3f1e2441f3b0872db1b214cbdb5bab87621e 100644 (file)
@@ -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
     }
 
This page took 0.08468 seconds and 5 git commands to generate.