------- Comment #7 from rguenth at gcc dot gnu dot org 2009-09-30 13:01 ------- During pure_const_read_summary lto_cgraph_encoder_deref returns a reference to a bogus cgraph node (it's all zeros, just the UID is filled in). Later the cgraph node gets reused by cgraph_clone_node. So something like the following solves this for the testcase:
Index: ipa-pure-const.c =================================================================== --- ipa-pure-const.c (revision 152324) +++ ipa-pure-const.c (working copy) @@ -788,7 +788,8 @@ pure_const_read_summary (void) index = lto_input_uleb128 (ib); encoder = file_data->cgraph_node_encoder; node = lto_cgraph_encoder_deref (encoder, index); - set_function_state (node, fs); + if (node->decl) + set_function_state (node, fs); /* Note that the flags must be read in the opposite order in which they were written (the bitflags were -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41487