aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-10-08 15:20:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-10-08 15:20:13 +0000
commit8686c474f718468adeaf5663f0ad4e0721ef2ab0 (patch)
treed62ad1cfdc8e1a0d094175d74989ff5a8b3d7e5b /gcc
parenta75bfaa6cdea2dd7c2e8ac2aa4f52267b3213362 (diff)
downloadgcc-8686c474f718468adeaf5663f0ad4e0721ef2ab0.zip
gcc-8686c474f718468adeaf5663f0ad4e0721ef2ab0.tar.gz
gcc-8686c474f718468adeaf5663f0ad4e0721ef2ab0.tar.bz2
lto-streamer-out.c (lto_output_ts_block_tree_pointers): Do not output BLOCK_SUBBLOCKS.
2010-10-08 Richard Guenther <rguenther@suse.de> * lto-streamer-out.c (lto_output_ts_block_tree_pointers): Do not output BLOCK_SUBBLOCKS. * lto-streamer-in.c (lto_input_ts_block_tree_pointers): Reserve exact space needed for BLOCK_NONLOCALIZED_VARS. Re-construct BLOCK_SUBBLOCKS of parent block. (lto_input_ts_binfo_tree_pointers): Reserve exact space needed for BINFO_BASE_ACCESSES. From-SVN: r165190
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/lto-streamer-in.c30
-rw-r--r--gcc/lto-streamer-out.c3
3 files changed, 35 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12eb6d7..f713eff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-08 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-out.c (lto_output_ts_block_tree_pointers):
+ Do not output BLOCK_SUBBLOCKS.
+ * lto-streamer-in.c (lto_input_ts_block_tree_pointers):
+ Reserve exact space needed for BLOCK_NONLOCALIZED_VARS.
+ Re-construct BLOCK_SUBBLOCKS of parent block.
+ (lto_input_ts_binfo_tree_pointers): Reserve exact space needed
+ for BINFO_BASE_ACCESSES.
+
2010-10-08 Joseph Myers <joseph@codesourcery.com>
* Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h.
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index c6d3c9b..8061fe3 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -2139,17 +2139,29 @@ lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
len = lto_input_uleb128 (ib);
- for (i = 0; i < len; i++)
+ if (len > 0)
{
- tree t = lto_input_tree (ib, data_in);
- VEC_safe_push (tree, gc, BLOCK_NONLOCALIZED_VARS (expr), t);
+ VEC_reserve_exact (tree, gc, BLOCK_NONLOCALIZED_VARS (expr), len);
+ for (i = 0; i < len; i++)
+ {
+ tree t = lto_input_tree (ib, data_in);
+ VEC_quick_push (tree, BLOCK_NONLOCALIZED_VARS (expr), t);
+ }
}
BLOCK_SUPERCONTEXT (expr) = lto_input_tree (ib, data_in);
BLOCK_ABSTRACT_ORIGIN (expr) = lto_input_tree (ib, data_in);
BLOCK_FRAGMENT_ORIGIN (expr) = lto_input_tree (ib, data_in);
BLOCK_FRAGMENT_CHAIN (expr) = lto_input_tree (ib, data_in);
- BLOCK_SUBBLOCKS (expr) = lto_input_chain (ib, data_in);
+ /* We re-compute BLOCK_SUBBLOCKS of our parent here instead
+ of streaming it. For non-BLOCK BLOCK_SUPERCONTEXTs we still
+ stream the child relationship explicitly. */
+ if (BLOCK_SUPERCONTEXT (expr)
+ && TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == BLOCK)
+ {
+ BLOCK_CHAIN (expr) = BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr));
+ BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr)) = expr;
+ }
}
@@ -2183,10 +2195,14 @@ lto_input_ts_binfo_tree_pointers (struct lto_input_block *ib,
BINFO_VPTR_FIELD (expr) = lto_input_tree (ib, data_in);
len = lto_input_uleb128 (ib);
- for (i = 0; i < len; i++)
+ if (len > 0)
{
- tree a = lto_input_tree (ib, data_in);
- VEC_safe_push (tree, gc, BINFO_BASE_ACCESSES (expr), a);
+ VEC_reserve_exact (tree, gc, BINFO_BASE_ACCESSES (expr), len);
+ for (i = 0; i < len; i++)
+ {
+ tree a = lto_input_tree (ib, data_in);
+ VEC_quick_push (tree, BINFO_BASE_ACCESSES (expr), a);
+ }
}
BINFO_INHERITANCE_CHAIN (expr) = lto_input_tree (ib, data_in);
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index addf2c0..0ece96b 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1065,7 +1065,8 @@ lto_output_ts_block_tree_pointers (struct output_block *ob, tree expr,
lto_output_tree_or_ref (ob, BLOCK_ABSTRACT_ORIGIN (expr), ref_p);
lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_ORIGIN (expr), ref_p);
lto_output_tree_or_ref (ob, BLOCK_FRAGMENT_CHAIN (expr), ref_p);
- lto_output_chain (ob, BLOCK_SUBBLOCKS (expr), ref_p);
+ /* Do not output BLOCK_SUBBLOCKS. Instead on streaming-in this
+ list is re-constructed from BLOCK_SUPERCONTEXT. */
}