summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-04 19:17:57 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-04 19:17:57 +0000
commit0722e7670e03688f2ae7ac501d27500c8b86ac93 (patch)
treec04b42369024dbf54f104e1c586486f789707a54 /gcc/varasm.c
parentfff41eb0570ed8e7b8fca4e9664f6785968fb129 (diff)
downloadgcc-0722e7670e03688f2ae7ac501d27500c8b86ac93.tar.gz
* varasm.c (align_variable): Don't increase alignment for
DECL_THREAD_LOCAL_P variables above BITS_PER_WORD through DATA_ALIGNMENT or CONSTANT_ALIGNMENT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124442 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f8ce7263065..743c3f1e244 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
}