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

Issue 4667049: [pph] Allow DECL_LANG_SPECIFIC to be shared (Closed)

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

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -6 lines) Patch
M gcc/cp/ChangeLog.pph View 1 chunk +6 lines, -0 lines 0 comments Download
M gcc/cp/pph-streamer-in.c View 1 chunk +11 lines, -6 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 10 months ago (2011-06-29 20:50:45 UTC) #1
This is a patch that Lawrence and I were working on yesterday
that I need for my next patch.  We were not expecting
DECL_LANG_SPECIFIC to be shared, but in fact there are several
occasions (thunks, aliases) where it is shared.

By itself, this does not fix any tests, but it fixes a problem
exposed by the next patch.

Tested on x86_64.  Committed to the branch.

2011-06-29   Diego Novillo  <dnovillo@google.com>
 	     Lawrence Crowl  <crowl@google.com>

	* pph-streamer-in.c (pph_in_lang_specific): Expect shared
	DECL_LANG_SPECIFIC fields.

diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph
index a62dd66..9465484 100644
--- a/gcc/cp/ChangeLog.pph
+++ b/gcc/cp/ChangeLog.pph
@@ -1,4 +1,10 @@
 2011-06-29   Diego Novillo  <dnovillo@google.com>
+	     Lawrence Crowl  <crowl@google.com>
+
+	* pph-streamer-in.c (pph_in_lang_specific): Expect shared
+	DECL_LANG_SPECIFIC fields.
+
+2011-06-29   Diego Novillo  <dnovillo@google.com>
 
 	* pph-streamer-in.c (pph_read_tree): Call
 	append_to_statement_list_force instead of append_to_statement_list.
diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 1a59640..1c71c30 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -881,18 +881,23 @@ pph_in_lang_specific (pph_stream *stream, tree decl)
   marker = pph_in_start_record (stream, &ix);
   if (marker == PPH_RECORD_END)
     return;
-
-  /* Since lang_decl is embedded in every decl, LD cannot
-     be shared.  */
-  gcc_assert (marker != PPH_RECORD_SHARED);
+  else if (marker == PPH_RECORD_SHARED)
+    {
+      DECL_LANG_SPECIFIC (decl) =
+	(struct lang_decl *) pph_in_shared_data (stream, ix);
+      return;
+    }
 
   /* Allocate a lang_decl structure for DECL.  */
   retrofit_lang_decl (decl);
-
   ld = DECL_LANG_SPECIFIC (decl);
-  ldb = &ld->u.base;
+
+  /* Now register it.  We would normally use ALLOC_AND_REGISTER,
+     but retrofit_lang_decl does not return a pointer.  */
+  pph_register_shared_data (stream, ld, ix);
 
   /* Read all the fields in lang_decl_base.  */
+  ldb = &ld->u.base;
   pph_in_ld_base (stream, ldb);
 
   if (ldb->selector == 0)

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

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