diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-14 12:33:32 +0100 |
---|---|---|
committer | Rafaël Carré <funman@videolan.org> | 2012-11-14 12:33:32 +0100 |
commit | dbda07b889c36b947e4e2cd5eeae9b92fe948a1f (patch) | |
tree | c78f6ae38e8700a75d23203fcb64a582494cba9a /gcc-4.6/gcc/cp/decl.c | |
parent | 3c56f697e112c79fb5457538fdc373e348beca24 (diff) | |
download | toolchain_gcc-dbda07b889c36b947e4e2cd5eeae9b92fe948a1f.tar.gz toolchain_gcc-dbda07b889c36b947e4e2cd5eeae9b92fe948a1f.tar.bz2 toolchain_gcc-dbda07b889c36b947e4e2cd5eeae9b92fe948a1f.zip |
Backported from mainline
2012-02-14 Jakub Jelinek <jakub@redhat.com>
PR c/52181
* c-decl.c (merge_decls): Copy DECL_USER_ALIGN bit from olddecl to
newdecl.
* decl.c (duplicate_decls): If olddecl has bigger DECL_ALIGN than
newdecl, copy DECL_ALIGN to newdecl and or DECL_USER_ALIGN bits.
* c-c++-common/pr52181.c: New test.
Diffstat (limited to 'gcc-4.6/gcc/cp/decl.c')
-rw-r--r-- | gcc-4.6/gcc/cp/decl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc-4.6/gcc/cp/decl.c b/gcc-4.6/gcc/cp/decl.c index ff3baa54b..69595a97b 100644 --- a/gcc-4.6/gcc/cp/decl.c +++ b/gcc-4.6/gcc/cp/decl.c @@ -2156,7 +2156,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) SET_DECL_INIT_PRIORITY (olddecl, DECL_INIT_PRIORITY (newdecl)); DECL_HAS_INIT_PRIORITY_P (olddecl) = 1; } - /* Likewise for DECL_USER_ALIGN and DECL_PACKED. */ + /* Likewise for DECL_ALIGN, DECL_USER_ALIGN and DECL_PACKED. */ + if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl)) + { + DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl); + DECL_USER_ALIGN (newdecl) |= DECL_USER_ALIGN (olddecl); + } DECL_USER_ALIGN (olddecl) = DECL_USER_ALIGN (newdecl); if (TREE_CODE (newdecl) == FIELD_DECL) DECL_PACKED (olddecl) = DECL_PACKED (newdecl); |