This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Merge cgraph_get_create_node and cgraph_get_create_real_symbol_node


Hello!

>>>>> as discussed with Honza on many occasions, all users of
>>>>> cgraph_get_create_node really want cgraph_get_create_real_symbol_node,
>>>>> i.e. they are not interested in inline nodes and should get a
>>>>> standalone node instead.  So this patch changes cgraph_get_create_node
>>>>> to do what cgraph_get_create_real_symbol_node currently does and
>>>>> removes the latter altogether.
>>>>>
>>>>> I had to change a call to cgraph_get_create_node to cgraph_get_node in
>>>>> lto-streamer-in.c so that it does not make the node it operates on a
>>>>> clone of another one because this made ipa_pta_execute abort on assert
>>>>> after calling cgraph_get_body (visionary points to Richi for putting
>>>>> the assert there).
>>>>>
>>>>> The patch successfully passed bootstrap and testing ("all" languages +
>>>>> Ada) and LTO-bootstrap (C and C++ only) on x86_64-linux.
>>>>>
>>>>> 2013-11-12  Martin Jambor  <mjambor@suse.cz>
>>>>>
>>>>> * cgraph.c (cgraph_get_create_node): Do what
>>>>> cgraph_get_create_real_symbol_node used to do.
>>>>> (cgraph_get_create_real_symbol_node): Removed.  Changed all users to
>>>>> call cgraph_get_create_node.
>>>>> * cgraph.h (cgraph_get_create_real_symbol_node): Removed.
>>>>> * lto-streamer-in.c (input_function): Call cgraph_get_node instead of
>>>>> cgraph_get_create_node.  Assert we get a node.
>>>>
>>>> This patch breaks lto-profiledbootstrap on x86_64-pc-linux-gnu with:
>>>>
>>>> In function ‘colorize_start’:
>>>> lto1: internal compiler error: in input_function, at lto-streamer-in.c:919
>>>> 0xa585c1 input_function
>>>>         /home/uros/gcc-svn/trunk/gcc/lto-streamer-in.c:919
>>>> 0xa585c1 lto_read_body
>>>>         /home/uros/gcc-svn/trunk/gcc/lto-streamer-in.c:1067
>>>> 0xa585c1 lto_input_function_body(lto_file_decl_data*, cgraph_node*, char const*)
>>>>         /home/uros/gcc-svn/trunk/gcc/lto-streamer-in.c:1109
>>>> 0x66eb2c cgraph_get_body(cgraph_node*)
>>>>         /home/uros/gcc-svn/trunk/gcc/cgraph.c:2967
>>>> 0x999339 ipa_merge_profiles(cgraph_node*, cgraph_node*)
>>>>         /home/uros/gcc-svn/trunk/gcc/ipa-utils.c:699
>>>> 0x5979a6 lto_cgraph_replace_node
>>>>         /home/uros/gcc-svn/trunk/gcc/lto/lto-symtab.c:82
>>>> 0x598079 lto_symtab_merge_symbols_1
>>>>         /home/uros/gcc-svn/trunk/gcc/lto/lto-symtab.c:561
>>>> 0x598079 lto_symtab_merge_symbols()
>>>>         /home/uros/gcc-svn/trunk/gcc/lto/lto-symtab.c:589
>>>> 0x586fad read_cgraph_and_symbols
>>>>         /home/uros/gcc-svn/trunk/gcc/lto/lto.c:2945
>>>> 0x586fad lto_main()
>>>>         /home/uros/gcc-svn/trunk/gcc/lto/lto.c:3254
>>>>
>>>> You will need patches from Teresa [1],[2] to get up to there in the
>>>> lto-profiledbootstrap.
>>>
>>> These patches are now in mainline, the failure is confirmed by HJ's
>>> buildboot at http://gcc.gnu.org/ml/gcc-regression/2013-11/msg00350.html
>>
>> I was able to finish LTO profiledbootstrap with a partial revert of:
>>
>>         * lto-streamer-in.c (input_function): Call cgraph_get_node instead of
>>           cgraph_get_create_node.  Assert we get a node.
>>
>> Index: lto-streamer-in.c
>> ===================================================================
>> --- lto-streamer-in.c   (revision 204792)
>> +++ lto-streamer-in.c   (working copy)
>> @@ -916,8 +916,7 @@ input_function (tree fn_decl, struct data_in *data
>>
>>    gimple_register_cfg_hooks ();
>>
>> -  node = cgraph_get_node (fn_decl);
>> -  gcc_checking_assert (node);
>> +  node = cgraph_get_create_node (fn_decl);
>>    input_struct_function_base (fn, data_in, ib);
>>    input_cfg (ib_cfg, fn, node->count_materialization_scale);
>
> This would mean that cgraph merging is broken.

Please see updated patch [1] and Honza's comment in approval.

[1] http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01670.html

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]