We were not handling TYPE_DECLs properly.  They were being handled by
the first if, but the second one was an 'else if'.  Sigh.

Tested on x86_64.


Diego.

        * pph-streamer-in.c (pph_stream_read_tree): Fix handling of
        TYPE_DECLs.
        * pph-streamer-out.c (pph_stream_write_tree): Likewise.

diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph
index f717f85..7a92278 100644
--- a/gcc/cp/ChangeLog.pph
+++ b/gcc/cp/ChangeLog.pph
@@ -1,3 +1,9 @@
+2011-04-14  Diego Novillo  <dnovi...@google.com>
+
+       * pph-streamer-in.c (pph_stream_read_tree): Fix handling of
+       TYPE_DECLs.
+       * pph-streamer-out.c (pph_stream_write_tree): Likewise.
+
 2011-04-13  Diego Novillo  <dnovi...@google.com>
 
        * name-lookup.c (pph_stream_write_binding_table): Handle
diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 335fab6..c98c2f4 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -784,7 +784,8 @@ pph_stream_read_tree (struct lto_input_block *ib 
ATTRIBUTE_UNUSED,
          if (TREE_CODE (expr) == FUNCTION_DECL)
            DECL_SAVED_TREE (expr) = pph_input_tree (stream);
        }
-      else if (TREE_CODE (expr) == TYPE_DECL)
+
+      if (TREE_CODE (expr) == TYPE_DECL)
        DECL_ORIGINAL_TYPE (expr) = pph_input_tree (stream);
     }
   else if (TREE_CODE (expr) == STATEMENT_LIST)
diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c
index 16c8543..babf751 100644
--- a/gcc/cp/pph-streamer-out.c
+++ b/gcc/cp/pph-streamer-out.c
@@ -789,7 +789,8 @@ pph_stream_write_tree (struct output_block *ob, tree expr, 
bool ref_p)
          if (TREE_CODE (expr) == FUNCTION_DECL)
            pph_output_tree_aux (stream, DECL_SAVED_TREE (expr), ref_p);
        }
-      else if (TREE_CODE (expr) == TYPE_DECL)
+
+      if (TREE_CODE (expr) == TYPE_DECL)
        pph_output_tree (stream, DECL_ORIGINAL_TYPE (expr), ref_p);
     }
   else if (TREE_CODE (expr) == STATEMENT_LIST)


--
This patch is available for review at http://codereview.appspot.com/4408045

Reply via email to