We need to stream TREE_TYPE for identifier node.

This fixes some ICEs, but introduces some new assembly mismatch errors.

Here is the testing diff:
47,49d46
< XPASS: g++.dg/pph/x1autometh.cc  -fpph-map=pph.map -I.  (test for bogus 
messages, line )
< XPASS: g++.dg/pph/x1autometh.cc  -fpph-map=pph.map -I. (test for excess 
errors)
< FAIL: g++.dg/pph/x1autometh.cc  (assembly mismatch)
51c48
< XPASS: g++.dg/pph/x1functions.cc  -fpph-map=pph.map -I. (test for excess 
errors)
---
> XPASS: g++.dg/pph/x1functions.cc  -I.  (test for bogus messages, line )
53,54d49
< XPASS: g++.dg/pph/x1special.cc  -fpph-map=pph.map -I.  (test for bogus 
messages, line )
< XPASS: g++.dg/pph/x1special.cc  -fpph-map=pph.map -I. (test for excess errors)
62d56
< XPASS: g++.dg/pph/x1typerefs.cc  -fpph-map=pph.map -I.  (test for bogus 
messages, line )
70,74c64,68
< # of expected passes          174
< # of unexpected failures      2
< # of unexpected successes     21
< # of expected failures                37
< /usr/local/google/gchare/gcc/dbg/gcc/testsuite/g++/../../g++  version 
4.7.0-pph 20110606 (experimental) (GCC) 
---
> # of expected passes          177
> # of unexpected failures      1
> # of unexpected successes     16
> # of expected failures                46
> /usr/local/google/gchare/gcc-clean/bld/gcc/testsuite/g++/../../g++  version 
> 4.7.0-pph 20110606 (experimental) (GCC)

2011-06-07  Gabriel Charette  <gch...@google.com>

        * gcc/cp/pph-streamer-in.c (pph_read_tree): 
        Read TREE_TYPE from id_node.
        * gcc/cp/pph-streamer-out.c (pph_write_tree):
        Write TREE_TYPE from id_node.
        * gcc/testsuite/g++.dg/pph/x1functions.cc (dg-xfail-if "ICE"): Remove.
        (dg-xfail-if "ERROR"): Add.

Index: gcc/cp/pph-streamer-in.c
===================================================================
--- gcc/cp/pph-streamer-in.c    (revision 174760)
+++ gcc/cp/pph-streamer-in.c    (working copy)
@@ -1027,6 +1027,7 @@
         id->bindings = pph_in_cxx_binding (stream);
         id->class_template_info = pph_in_tree (stream);
         id->label_value = pph_in_tree (stream);
+       TREE_TYPE (expr) = pph_in_tree (stream);
       }
       break;
 
Index: gcc/cp/pph-streamer-out.c
===================================================================
--- gcc/cp/pph-streamer-out.c   (revision 174760)
+++ gcc/cp/pph-streamer-out.c   (working copy)
@@ -983,6 +983,7 @@
         pph_out_cxx_binding (stream, id->bindings, ref_p);
         pph_out_tree_or_ref_1 (stream, id->class_template_info, ref_p, 3);
         pph_out_tree_or_ref_1 (stream, id->label_value, ref_p, 3);
+       pph_out_tree_or_ref_1 (stream, TREE_TYPE (expr), ref_p, 3);
       }
       break;
 
Index: gcc/testsuite/g++.dg/pph/x1functions.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1functions.cc     (revision 174760)
+++ gcc/testsuite/g++.dg/pph/x1functions.cc     (working copy)
@@ -1,6 +1,5 @@
-// { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } }
+// { dg-xfail-if "ERROR" { "*-*-*" } { "-fpph-map=pph.map" } }
 // { dg-bogus "'mbr_decl_inline' was not declared in this scope" "" { xfail 
*-*-* } 0 }
-// { dg-bogus "c1functions.h:8:34: internal compiler error: Segmentation 
fault" "" { xfail *-*-* } 0 }
 // { dg-prune-output "In file included from " }
 // { dg-prune-output "In member function " }
 // { dg-prune-output "At global scope:" }

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

Reply via email to