diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-01 08:52:33 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-01 08:52:33 +0000 |
commit | ed61b9099c0eda00fc19eaf1b3da3bd008a4c158 (patch) | |
tree | 076077eb59e88f362654a8c0a17e201cef22c8d7 /gcc/lto-streamer.c | |
parent | ff3c83b573655db50a75d59696ab4a8e7d3819ec (diff) | |
download | gcc-ed61b9099c0eda00fc19eaf1b3da3bd008a4c158.tar.gz |
2011-06-01 Richard Guenther <rguenther@suse.de>
* tree.c (free_lang_data): Do not reset boolean_type_node nor
char_type_node.
* lto-streamer.c (lto_record_common_node): Take node pointer,
do not register types.
(lto_preload_common_nodes): Explicitly skip preloading nodes
that differ between frontends.
lto/
* lto-lang.c (lto_register_canonical_types): New function.
(lto_init): Register common nodes with the canonical type machinery.
Do not play tricks with char_type_node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer.c')
-rw-r--r-- | gcc/lto-streamer.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index abccd10ccee..763ecc5e903 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -478,10 +478,8 @@ lto_streamer_cache_get (struct lto_streamer_cache_d *cache, unsigned ix) /* Record NODE in CACHE. */ static void -lto_record_common_node (struct lto_streamer_cache_d *cache, tree *nodep) +lto_record_common_node (struct lto_streamer_cache_d *cache, tree node) { - tree node = *nodep; - /* We have to make sure to fill exactly the same number of elements for all frontends. That can include NULL trees. As our hash table can't deal with zero entries we'll simply stream @@ -491,25 +489,12 @@ lto_record_common_node (struct lto_streamer_cache_d *cache, tree *nodep) if (!node) node = error_mark_node; - if (TYPE_P (node)) - { - /* Type merging will get confused by the canonical types as they - are set by the middle-end. */ - if (in_lto_p) - TYPE_CANONICAL (node) = NULL_TREE; - node = gimple_register_type (node); - TYPE_CANONICAL (node) = gimple_register_canonical_type (node); - if (in_lto_p) - TYPE_CANONICAL (*nodep) = TYPE_CANONICAL (node); - *nodep = node; - } - lto_streamer_cache_append (cache, node); if (POINTER_TYPE_P (node) || TREE_CODE (node) == COMPLEX_TYPE || TREE_CODE (node) == ARRAY_TYPE) - lto_record_common_node (cache, &TREE_TYPE (node)); + lto_record_common_node (cache, TREE_TYPE (node)); else if (TREE_CODE (node) == RECORD_TYPE) { /* The FIELD_DECLs of structures should be shared, so that every @@ -519,7 +504,7 @@ lto_record_common_node (struct lto_streamer_cache_d *cache, tree *nodep) nonoverlapping_component_refs_p). */ tree f; for (f = TYPE_FIELDS (node); f; f = TREE_CHAIN (f)) - lto_record_common_node (cache, &f); + lto_record_common_node (cache, f); } } @@ -553,16 +538,20 @@ lto_preload_common_nodes (struct lto_streamer_cache_d *cache) gcc_assert (fileptr_type_node == ptr_type_node); gcc_assert (TYPE_MAIN_VARIANT (fileptr_type_node) == ptr_type_node); - /* Skip itk_char. char_type_node is shared with the appropriately - signed variant. */ - for (i = itk_signed_char; i < itk_none; i++) - lto_record_common_node (cache, &integer_types[i]); + for (i = 0; i < itk_none; i++) + /* Skip itk_char. char_type_node is dependent on -f[un]signed-char. */ + if (i != itk_char) + lto_record_common_node (cache, integer_types[i]); for (i = 0; i < TYPE_KIND_LAST; i++) - lto_record_common_node (cache, &sizetype_tab[i]); + lto_record_common_node (cache, sizetype_tab[i]); for (i = 0; i < TI_MAX; i++) - lto_record_common_node (cache, &global_trees[i]); + /* Skip boolean type and constants, they are frontend dependent. */ + if (i != TI_BOOLEAN_TYPE + && i != TI_BOOLEAN_FALSE + && i != TI_BOOLEAN_TRUE) + lto_record_common_node (cache, global_trees[i]); } /* Create a cache of pickled nodes. */ |