diff options
author | Andre Vehreschild <vehre@gmx.de> | 2015-04-14 15:58:19 +0200 |
---|---|---|
committer | Andre Vehreschild <vehre@gmx.de> | 2015-04-14 15:58:19 +0200 |
commit | 93165dbdfd0406ae43d6dda7cb358fb8c1fcbad7 (patch) | |
tree | 69186c5617ba843643a58bafef5b351f811391c6 /gcc/cp/tree.c | |
parent | b70cd7cb6fd66a6f5dfbfb988861cec47c6e2c7a (diff) | |
parent | 33a2aaa4b5b40e1d705587d8fb669473263baff3 (diff) | |
download | gcc-vehre/base.tar.gz |
Merge remote-tracking branch 'trunk' of git://gcc.gnu.org/git/gcc into vehre/allvehre/base
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 97bccc03403..71c84ae38ef 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -880,12 +880,19 @@ build_cplus_array_type (tree elt_type, tree index_type) { t = build_min_array_type (elt_type, index_type); set_array_type_canon (t, elt_type, index_type); + if (!dependent) + { + layout_type (t); + /* Make sure sizes are shared with the main variant. + layout_type can't be called after setting TYPE_NEXT_VARIANT, + as it will overwrite alignment etc. of all variants. */ + TYPE_SIZE (t) = TYPE_SIZE (m); + TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (m); + } TYPE_MAIN_VARIANT (t) = m; TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m); TYPE_NEXT_VARIANT (m) = t; - if (!dependent) - layout_type (t); } } @@ -1072,6 +1079,8 @@ cp_build_qualified_type_real (tree type, { t = build_variant_type_copy (t); TYPE_NAME (t) = TYPE_NAME (type); + TYPE_ALIGN (t) = TYPE_ALIGN (type); + TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (type); } } |