aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-out.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-11-24 21:35:16 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-11-24 20:35:16 +0000
commitba6a6a1d44c17f25671162c00dafd9959818667f (patch)
treebfa02931487309252ffddfb0ef2cd4f62997167f /gcc/tree-streamer-out.c
parent0b87a9a2bd3835e62e690c8acd4bbb4b3bec27c7 (diff)
downloadgcc-ba6a6a1d44c17f25671162c00dafd9959818667f.zip
gcc-ba6a6a1d44c17f25671162c00dafd9959818667f.tar.gz
gcc-ba6a6a1d44c17f25671162c00dafd9959818667f.tar.bz2
alias.c (get_alias_set): Before checking TYPE_ALIAS_SET_KNOWN_P double check that type is main variant.
* alias.c (get_alias_set): Before checking TYPE_ALIAS_SET_KNOWN_P double check that type is main variant. * tree.c (build_variant_type_copy): Clear TYPE_ALIAS_SET when producing variant. (verify_type_variant): Verify that variants have no TYPE_ALIAS_SET_KNOWN_P set * tree-streamer-out.c (pack_ts_type_common_value_fields): Reorder streaming so constant fields come first; stream TYPE_ALIAS_SET==0 only for main variants; stream TYPE_ALIAS_SET as a bit. * tree-streamer-in.c (unpack_ts_type_common_value_fields): Update accordingly. From-SVN: r230838
Diffstat (limited to 'gcc/tree-streamer-out.c')
-rw-r--r--gcc/tree-streamer-out.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c
index d0b7f6d..ab9b747 100644
--- a/gcc/tree-streamer-out.c
+++ b/gcc/tree-streamer-out.c
@@ -313,6 +313,17 @@ pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
/* TYPE_NO_FORCE_BLK is private to stor-layout and need
no streaming. */
bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1);
+ bp_pack_value (bp, TYPE_PACKED (expr), 1);
+ bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
+ bp_pack_value (bp, TYPE_USER_ALIGN (expr), 1);
+ bp_pack_value (bp, TYPE_READONLY (expr), 1);
+ /* Make sure to preserve the fact whether the frontend would assign
+ alias-set zero to this type. Do that only for main variants, because
+ type variants alias sets are never computed.
+ FIXME: This does not work for pre-streamed builtin types. */
+ bp_pack_value (bp, (TYPE_ALIAS_SET (expr) == 0
+ || (!in_lto_p && TYPE_MAIN_VARIANT (expr) == expr
+ && get_alias_set (expr) == 0)), 1);
if (RECORD_OR_UNION_TYPE_P (expr))
{
bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1);
@@ -320,17 +331,8 @@ pack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
}
else if (TREE_CODE (expr) == ARRAY_TYPE)
bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1);
- bp_pack_value (bp, TYPE_PACKED (expr), 1);
- bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
- bp_pack_value (bp, TYPE_USER_ALIGN (expr), 1);
- bp_pack_value (bp, TYPE_READONLY (expr), 1);
bp_pack_var_len_unsigned (bp, TYPE_PRECISION (expr));
bp_pack_var_len_unsigned (bp, TYPE_ALIGN (expr));
- /* Make sure to preserve the fact whether the frontend would assign
- alias-set zero to this type. */
- bp_pack_var_len_int (bp, (TYPE_ALIAS_SET (expr) == 0
- || (!in_lto_p
- && get_alias_set (expr) == 0)) ? 0 : -1);
}