On Thu, Aug 11, 2011 at 04:45, Richard Guenther <rguent...@suse.de> wrote:
>> 5- Handle CALL_EXPR in lto_materialize_tree. Despite the name this is >> a generic tree streaming function (the renaming patch will come >> in the next few days). Handling CALL_EXPR does not >> affect LTO (since those nodes are never allowed), but it is a >> generic tree code so it makes more sense to handle it here. > > That's the only odd thing - because we reject it in > lto_is_streamable (). Why "does it make sense" to handle it there? > I don't think it makes sense - in fact you should be able to > replace its handling with gcc_unreachable (). Oh, I see, this > is in tree-streamer.c and thus to be renamed in subsequent patches? Correct. lto_is_streamable() will keep rejecting CALL_EXPRs, but the generic streamer handles it because it's, after all, a generic tree. There are other LTO-specific behaviour that need to be addressed in the tree streamer. For example, in lto_output_ts_binfo_tree_pointers() we have this code: /* BINFO_VIRTUALS is used to drive type based devirtualizatoin. It often links together large portions of programs making it harder to partition. Becuase devirtualization is interesting before inlining, only, there is no real need to ship it into ltrans partition. */ stream_write_tree (ob, flag_wpa ? NULL : BINFO_VIRTUALS (expr), ref_p); Right now, this does not affect PPH because -fwpa is never set, but it's a wart. One way of addressing this would be for lto_write_tree to clear out the BINFO_VIRTUALS on TREE_BINFO nodes before calling lto_output_tree_pointers, but that seems gross. Any other options? Diego.