diff options
author | Richard Guenther <rguenther@suse.de> | 2011-12-14 15:31:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-12-14 15:31:24 +0000 |
commit | 23ee14a5e62b15cfe437062e0368b9d2aad806c3 (patch) | |
tree | 62814e0331177a43121241c30633905e54022456 | |
parent | 9532fecfc59a064f99f30173a2fc59e33467c283 (diff) | |
download | gcc-23ee14a5e62b15cfe437062e0368b9d2aad806c3.zip gcc-23ee14a5e62b15cfe437062e0368b9d2aad806c3.tar.gz gcc-23ee14a5e62b15cfe437062e0368b9d2aad806c3.tar.bz2 |
re PR lto/51497 (The run time for the polyhedron test nf.f90 is ~10% slower with -flto after revision 182107)
2011-12-14 Richard Guenther <rguenther@suse.de>
PR lto/51497
* lto-streamer-in.c (lto_read_body): Fixup local types
TYPE_CANONICAL and variant chain.
From-SVN: r182336
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto-streamer-in.c | 27 |
2 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b763bbe..0aee51f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2011-12-14 Richard Guenther <rguenther@suse.de> + PR lto/51497 + * lto-streamer-in.c (lto_read_body): Fixup local types + TYPE_CANONICAL and variant chain. + +2011-12-14 Richard Guenther <rguenther@suse.de> + * tree.c (free_lang_data_in_type): Do not clear fields dependent on debuginfo level setting. (find_decls_types_r): Use TYPE_STUB_DECL rathern than TREE_CHAIN. diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index f2614cf..44513f7 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1012,6 +1012,7 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, struct function *fn = DECL_STRUCT_FUNCTION (fn_decl); struct lto_in_decl_state *decl_state; struct cgraph_node *node = cgraph_get_node (fn_decl); + unsigned from; gcc_checking_assert (node); push_cfun (fn); @@ -1025,7 +1026,33 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, input_cfg (&ib_cfg, fn, node->count_materialization_scale); /* Set up the struct function. */ + from = VEC_length (tree, data_in->reader_cache->nodes); input_function (fn_decl, data_in, &ib_main); + /* And fixup types we streamed locally. */ + { + struct streamer_tree_cache_d *cache = data_in->reader_cache; + unsigned len = VEC_length (tree, cache->nodes); + unsigned i; + for (i = len; i-- > from;) + { + tree t = VEC_index (tree, cache->nodes, i); + if (t == NULL_TREE) + continue; + + if (TYPE_P (t)) + { + gcc_assert (TYPE_CANONICAL (t) == NULL_TREE); + TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t); + if (TYPE_MAIN_VARIANT (t) != t) + { + gcc_assert (TYPE_NEXT_VARIANT (t) == NULL_TREE); + TYPE_NEXT_VARIANT (t) + = TYPE_NEXT_VARIANT (TYPE_MAIN_VARIANT (t)); + TYPE_NEXT_VARIANT (TYPE_MAIN_VARIANT (t)) = t; + } + } + } + } /* We should now be in SSA. */ cfun->gimple_df->in_ssa_p = true; |