@@ -1932,9 +1932,17 @@ pph_read_tree_header (pph_stream *stream, enum LTO_tags tag)
struct data_in *data_in = stream->encoder.r.data_in;
struct bitpack_d bp;
tree expr;
+ enum tree_code code;
- /* Allocate the tree. */
- expr = streamer_alloc_tree (ib, data_in, tag);
+ /* Allocate the tree. Handle C++-specific codes first. */
+ code = lto_tag_to_tree_code (tag);
+ if (code == AGGR_INIT_EXPR)
+ {
+ unsigned nargs = pph_in_uint (stream);
+ expr = build_vl_exp (AGGR_INIT_EXPR, nargs + 3);
+ }
+ else
+ expr = streamer_alloc_tree (ib, data_in, tag);
/* Read the language-independent bitfields for EXPR. */
bp = streamer_read_tree_bitfields (ib, expr);
@@ -1893,6 +1893,11 @@ pph_write_tree_header (pph_stream *stream, tree expr)
on the reading side. */
streamer_write_tree_header (ob, expr);
+ /* Process C++ specific codes that need more data in the header
+ for the reader to allocate them. */
+ if (TREE_CODE (expr) == AGGR_INIT_EXPR)
+ pph_out_uint (stream, aggr_init_expr_nargs (expr));
+
/* Pack all the non-pointer fields in EXPR into a bitpack and write
the resulting bitpack. */
bp = bitpack_create (ob->main_stream);