Re: [pph] More DECL merging. (issue5268042)
On Wed, Oct 12, 2011 at 23:36, Lawrence Crowl cr...@google.com wrote: Use the mangled name for merging, as this should enable us to handle function overloads. We use the regular identifier for other declarations, as that should be sufficient and avoids the problem of different typedefs mangling to the same name. Merge struct members as well as namespace members. This will eventually help with member declaration versus definition issues. Change test cases to reflect the above. Comment on other failing tests. Comment on failing cache handling for merge. Tested on x64. Index: gcc/testsuite/ChangeLog.pph 2011-10-12 Lawrence Crowl cr...@google.com * g++.dg/pph/p2pr36533.cc: Mark expected fail on unexpanded intrinsic. * g++.dg/pph/p4pr36533.cc: Likewise. * g++.dg/pph/p4mean.cc: Likewise. * g++.dg/pph/c3variables.cc: Comment on reason for fail. * g++.dg/pph/c4vardef.cc: Likewise. Index: gcc/cp/ChangeLog.pph 2011-10-12 Lawrence Crowl cr...@google.com * pph-streamer.h (pph_merge_name): New. * pph-streamer.c (pph_merge_name): New. * pph-streamer-out.c (pph_out_mergeable_tree_vec): Emit the vector in declaration order. (pph_out_merge_name): New. (pph_write_any_tree): Use pph_out_merge_name instead of raw code. * pph-streamer-in.c (pph_match_to_link): Use pph_merge_name. (pph_in_binding_level): Also merge members of structs. (pph_read_any_tree): Save read tree to determine if it is different from the tree to be used. Index: gcc/testsuite/g++.dg/pph/p2pr36533.cc === --- gcc/testsuite/g++.dg/pph/p2pr36533.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p2pr36533.cc (working copy) @@ -1,2 +1,6 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 25347 +// xfail BOGUS INTRINSIC +// failing to recognise memset as an intrinsic + #include p1pr36533.h Index: gcc/testsuite/g++.dg/pph/c3variables.cc === --- gcc/testsuite/g++.dg/pph/c3variables.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/c3variables.cc (working copy) @@ -1,4 +1,5 @@ // pph asm xdiff 34997 +// xfail BOGUS DUPVAR // tentative definition emitted twice #include c0variables1.h Index: gcc/testsuite/g++.dg/pph/p4mean.cc === --- gcc/testsuite/g++.dg/pph/p4mean.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p4mean.cc (working copy) @@ -1,4 +1,8 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 39234 +// xfail BOGUS INTRINSIC +// failing to recognize sqrt as an intrinsic + #include stdlib.h #include stdio.h #include math.h Index: gcc/testsuite/g++.dg/pph/p4pr36533.cc === --- gcc/testsuite/g++.dg/pph/p4pr36533.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p4pr36533.cc (working copy) @@ -1,2 +1,6 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 25347 +// xfail BOGUS INTRINSIC +// failing to recognise memset as an intrinsic + #include p4pr36533.h Index: gcc/testsuite/g++.dg/pph/c4vardef.cc === --- gcc/testsuite/g++.dg/pph/c4vardef.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/c4vardef.cc (working copy) @@ -1,4 +1,6 @@ // pph asm xdiff 00553 +// xfail BOGUS DUPVAR +// definition emitted twice #include c0vardef1.h #include c0vardef2.h Index: gcc/cp/pph-streamer-in.c === --- gcc/cp/pph-streamer-in.c (revision 179880) +++ gcc/cp/pph-streamer-in.c (working copy) @@ -803,7 +803,7 @@ pph_match_to_function (tree expr ATTRIBU against an LINK of a chain. */ static tree -pph_match_to_link (tree expr, location_t where, const char *idstr, tree* link) +pph_match_to_link (tree expr, location_t where, const char *idstr, tree *link) { enum tree_code link_code, expr_code; tree idtree; @@ -817,7 +817,7 @@ pph_match_to_link (tree expr, location_t if (link_code != expr_code) return NULL; - idtree = DECL_NAME (*link); + idtree = pph_merge_name (*link); if (!idtree) return NULL; @@ -1072,7 +1072,7 @@ pph_in_binding_level (cp_binding_level * *out_field = bl; entity = bl-this_entity = pph_in_tree (stream); - if (NAMESPACE_SCOPE_P (entity)) + if (NAMESPACE_SCOPE_P (entity) || DECL_CLASS_SCOPE_P (entity)) { if (flag_pph_debug = 3) debug_tree_chain (bl-names); @@ -1962,7 +1962,8 @@ pph_read_any_tree (pph_stream *stream, t { struct lto_input_block *ib = stream-encoder.r.ib; struct data_in *data_in = stream-encoder.r.data_in; - tree expr = NULL_TREE; + tree read = NULL; + tree expr = NULL; enum pph_record_marker
Re: [pph] More DECL merging. (issue5268042)
I'm seeing an infinite loop in g++.dg/pph/c1limits-externalid.cc. The while() loop in pph_search_in_chain is not ending. Or maybe it's falling into the N^2 trap you mention in that routine? I've added a short timeout to this test and XFAIL'd it so you can debug it. Diego.
[pph] More DECL merging. (issue5268042)
Use the mangled name for merging, as this should enable us to handle function overloads. We use the regular identifier for other declarations, as that should be sufficient and avoids the problem of different typedefs mangling to the same name. Merge struct members as well as namespace members. This will eventually help with member declaration versus definition issues. Change test cases to reflect the above. Comment on other failing tests. Comment on failing cache handling for merge. Tested on x64. Index: gcc/testsuite/ChangeLog.pph 2011-10-12 Lawrence Crowl cr...@google.com * g++.dg/pph/p2pr36533.cc: Mark expected fail on unexpanded intrinsic. * g++.dg/pph/p4pr36533.cc: Likewise. * g++.dg/pph/p4mean.cc: Likewise. * g++.dg/pph/c3variables.cc: Comment on reason for fail. * g++.dg/pph/c4vardef.cc: Likewise. Index: gcc/cp/ChangeLog.pph 2011-10-12 Lawrence Crowl cr...@google.com * pph-streamer.h (pph_merge_name): New. * pph-streamer.c (pph_merge_name): New. * pph-streamer-out.c (pph_out_mergeable_tree_vec): Emit the vector in declaration order. (pph_out_merge_name): New. (pph_write_any_tree): Use pph_out_merge_name instead of raw code. * pph-streamer-in.c (pph_match_to_link): Use pph_merge_name. (pph_in_binding_level): Also merge members of structs. (pph_read_any_tree): Save read tree to determine if it is different from the tree to be used. Index: gcc/testsuite/g++.dg/pph/p2pr36533.cc === --- gcc/testsuite/g++.dg/pph/p2pr36533.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p2pr36533.cc (working copy) @@ -1,2 +1,6 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 25347 +// xfail BOGUS INTRINSIC +// failing to recognise memset as an intrinsic + #include p1pr36533.h Index: gcc/testsuite/g++.dg/pph/c3variables.cc === --- gcc/testsuite/g++.dg/pph/c3variables.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/c3variables.cc (working copy) @@ -1,4 +1,5 @@ // pph asm xdiff 34997 +// xfail BOGUS DUPVAR // tentative definition emitted twice #include c0variables1.h Index: gcc/testsuite/g++.dg/pph/p4mean.cc === --- gcc/testsuite/g++.dg/pph/p4mean.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p4mean.cc (working copy) @@ -1,4 +1,8 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 39234 +// xfail BOGUS INTRINSIC +// failing to recognize sqrt as an intrinsic + #include stdlib.h #include stdio.h #include math.h Index: gcc/testsuite/g++.dg/pph/p4pr36533.cc === --- gcc/testsuite/g++.dg/pph/p4pr36533.cc (revision 179880) +++ gcc/testsuite/g++.dg/pph/p4pr36533.cc (working copy) @@ -1,2 +1,6 @@ /* { dg-options -w -fpermissive } */ +// pph asm xdiff 25347 +// xfail BOGUS INTRINSIC +// failing to recognise memset as an intrinsic + #include p4pr36533.h Index: gcc/testsuite/g++.dg/pph/c4vardef.cc === --- gcc/testsuite/g++.dg/pph/c4vardef.cc(revision 179880) +++ gcc/testsuite/g++.dg/pph/c4vardef.cc(working copy) @@ -1,4 +1,6 @@ // pph asm xdiff 00553 +// xfail BOGUS DUPVAR +// definition emitted twice #include c0vardef1.h #include c0vardef2.h Index: gcc/cp/pph-streamer-in.c === --- gcc/cp/pph-streamer-in.c(revision 179880) +++ gcc/cp/pph-streamer-in.c(working copy) @@ -803,7 +803,7 @@ pph_match_to_function (tree expr ATTRIBU against an LINK of a chain. */ static tree -pph_match_to_link (tree expr, location_t where, const char *idstr, tree* link) +pph_match_to_link (tree expr, location_t where, const char *idstr, tree *link) { enum tree_code link_code, expr_code; tree idtree; @@ -817,7 +817,7 @@ pph_match_to_link (tree expr, location_t if (link_code != expr_code) return NULL; - idtree = DECL_NAME (*link); + idtree = pph_merge_name (*link); if (!idtree) return NULL; @@ -1072,7 +1072,7 @@ pph_in_binding_level (cp_binding_level * *out_field = bl; entity = bl-this_entity = pph_in_tree (stream); - if (NAMESPACE_SCOPE_P (entity)) + if (NAMESPACE_SCOPE_P (entity) || DECL_CLASS_SCOPE_P (entity)) { if (flag_pph_debug = 3) debug_tree_chain (bl-names); @@ -1962,7 +1962,8 @@ pph_read_any_tree (pph_stream *stream, t { struct lto_input_block *ib = stream-encoder.r.ib; struct data_in *data_in = stream-encoder.r.data_in; - tree expr = NULL_TREE; + tree read = NULL; + tree expr = NULL; enum pph_record_marker marker; unsigned image_ix, ix; enum LTO_tags tag; @@ -1998,9 +1999,11 @@ pph_read_any_tree (pph_stream *stream, t /* Materialize a new node