aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-12-21 15:56:11 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-12-21 15:56:11 +0000
commitb03eda0dcdb63b3a644e5eba8d7177d9acdae9e1 (patch)
treea09b0dd59969e9b6aabe8c921abd1c1e0386a79a /gcc/lto
parentd6e1acf654f4b21e1f8fd4be43f01e2dcec2dbd0 (diff)
downloadgcc-b03eda0dcdb63b3a644e5eba8d7177d9acdae9e1.zip
gcc-b03eda0dcdb63b3a644e5eba8d7177d9acdae9e1.tar.gz
gcc-b03eda0dcdb63b3a644e5eba8d7177d9acdae9e1.tar.bz2
lto.c (GIMPLE_REGISTER_TYPE): New define.
2011-12-21 Richard Guenther <rguenther@suse.de> lto/ * lto.c (GIMPLE_REGISTER_TYPE): New define. (LTO_FIXUP_TREE): Use it. (uniquify_nodes): Mark new non-prevailing types and avoid calling gimple_register_type on others. (lto_read_decls): Add comment. From-SVN: r182591
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog8
-rw-r--r--gcc/lto/lto.c21
2 files changed, 25 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 73a9cba..8882abe 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,11 @@
+2011-12-21 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (GIMPLE_REGISTER_TYPE): New define.
+ (LTO_FIXUP_TREE): Use it.
+ (uniquify_nodes): Mark new non-prevailing types and avoid
+ calling gimple_register_type on others.
+ (lto_read_decls): Add comment.
+
2011-12-13 Eric Botcazou <ebotcazou@adacore.com>
* lto.h (lto_parse_hex): Delete.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index d84dbfd..9efd9c3 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -306,13 +306,16 @@ remember_with_vars (tree t)
*(tree *) htab_find_slot (tree_with_vars, t, INSERT) = t;
}
+#define GIMPLE_REGISTER_TYPE(tt) \
+ (TREE_VISITED (tt) ? gimple_register_type (tt) : tt)
+
#define LTO_FIXUP_TREE(tt) \
do \
{ \
if (tt) \
{ \
if (TYPE_P (tt)) \
- (tt) = gimple_register_type (tt); \
+ (tt) = GIMPLE_REGISTER_TYPE (tt); \
if (VAR_OR_FUNCTION_DECL_P (tt) && TREE_PUBLIC (tt)) \
remember_with_vars (t); \
} \
@@ -731,7 +734,14 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
{
tree t = VEC_index (tree, cache->nodes, i);
if (t && TYPE_P (t))
- gimple_register_type (t);
+ {
+ tree newt = gimple_register_type (t);
+ /* Mark non-prevailing types so we fix them up. No need
+ to reset that flag afterwards - nothing that refers
+ to those types is left and they are collected. */
+ if (newt != t)
+ TREE_VISITED (t) = 1;
+ }
}
/* Second fixup all trees in the new cache entries. */
@@ -749,7 +759,7 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
continue;
/* Now try to find a canonical variant of T itself. */
- t = gimple_register_type (t);
+ t = GIMPLE_REGISTER_TYPE (t);
if (t == oldt)
{
@@ -771,7 +781,7 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
}
/* Query our new main variant. */
- mv = gimple_register_type (TYPE_MAIN_VARIANT (t));
+ mv = GIMPLE_REGISTER_TYPE (TYPE_MAIN_VARIANT (t));
/* If we were the variant leader and we get replaced ourselves drop
all variants from our list. */
@@ -901,6 +911,9 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
data_in = lto_data_in_create (decl_data, (const char *) data + string_offset,
header->string_size, resolutions);
+ /* We do not uniquify the pre-loaded cache entries, those are middle-end
+ internal types that should not be merged. */
+
/* Read the global declarations and types. */
while (ib_main.p < ib_main.len)
{