Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(582)

Issue 5246056: [pph] Fix handling of AGGR_INIT_EXPRs (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by Diego Novillo
Modified:
12 years, 6 months ago
Reviewers:
CC:
Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M gcc/cp/pph-streamer-in.c View 1 chunk +10 lines, -2 lines 0 comments Download
M gcc/cp/pph-streamer-out.c View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 6 months ago (2011-10-12 02:35:13 UTC) #1
We were not saving enough data in the header of AGGR_INIT_EXPRs.
This does not fix any failures yet (the test case that uses these is
failing due to merging).

Tested on x86_64.


Diego.


	* pph-streamer-in.c (pph_read_tree_header): Handle AGGR_INIT_EXPR.
	* pph-streamer-out.c (pph_write_tree_header): Likewise.

diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index ffa1433..1541ef9 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -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);
diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c
index 6a8db20..97566fd 100644
--- a/gcc/cp/pph-streamer-out.c
+++ b/gcc/cp/pph-streamer-out.c
@@ -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);

--
This patch is available for review at http://codereview.appspot.com/5246056
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b