On Wed, 26 Sep 2018 10:59:02 +0200 Martin Liška wrote: > On 9/25/18 3:34 PM, Jeff Law wrote: > > On 9/25/18 6:19 AM, Richard Biener wrote: > >> On Tue, Sep 25, 2018 at 9:09 AM Martin Liška > >> wrote: > >>> > >>> On 9/24/18 4:42 PM, Jeff Law wrote: > >>>> On 9/22/18 1:08 PM, marxin wrote: > >>>>> > >>>>> gcc/ChangeLog: > >>>>> > >>>>> 2018-09-24 Martin Liska > >>>>> > >>>>> * alias.c (set_dest_equal_p): Remove unused function. > >>>>> * config/i386/i386.c (def_builtin_pure2): Likewise. > >>>>> * diagnostic-show-locus.c (class layout): Remove > >>>>> unused field. > >>>>> (layout::layout): Likewise here. > >>>>> * dump-context.h (class temp_dump_context): Likewise. > >>>>> * dwarf2out.c (add_AT_fde_ref): Remove unused function. > >>>>> (add_AT_loclistsptr): Likewise. > >>>>> (add_AT_offset): Likewise. > >>>>> (get_AT_hi_pc): Likewise. > >>>>> (is_comdat_die): Likewise. > >>>>> (type_is_enum): Likewise. > >>>>> (ceiling): Likewise. > >>>>> (add_AT_vms_delta): Likewise. > >>>>> (is_class_die): Likewise. > >>>>> * edit-context.c (class line_event): Remove unused field. > >>>>> * graphite-sese-to-poly.c (tree_int_to_gmp): Remove > >>>>> unused function. > >>>>> * ipa-cp.c (ipa_get_vr_lat): Likewise. > >>>>> * lra-constraints.c (ok_for_index_p_nonstrict): Likewise. > >>>>> (ok_for_base_p_nonstrict): Likewise. > >>>>> * tree-chrec.c (is_not_constant_evolution): Likewise. > >>>>> (chrec_fold_poly_cst): Likewise. > >>>>> * tree-if-conv.c (has_pred_critical_p): Likewise. > >>>>> * tree-ssa-coalesce.c (print_exprs): Likewise. > >>>>> * tree-ssa-pre.c (bitmap_set_contains_expr): Likewise. > >>>>> * tree-ssa-uninit.c (is_and_or_or_p): Likewise. > >>>>> * tree-vrp.c (value_ranges_intersect_p): Likewise. > >>>>> (value_range_nonnegative_p): Likewise. > >>>>> > >>>>> gcc/cp/ChangeLog: > >>>>> > >>>>> 2018-09-24 Martin Liska > >>>>> > >>>>> * name-lookup.c (namespace_scope_ht_size): Remove > >>>>> unused function. > >>>>> * parser.c (cp_lexer_next_token_is_not_keyword): Likewise. > >>>>> > >>>>> gcc/fortran/ChangeLog: > >>>>> > >>>>> 2018-09-24 Martin Liska > >>>>> > >>>>> * trans.c (remove_suffix): Remove > >>>>> unused function. > >>>>> > >>>>> gcc/go/ChangeLog: > >>>>> > >>>>> 2018-09-24 Martin Liska > >>>>> > >>>>> * gofrontend/escape.cc (Gogo::analyze_escape): Remove > >>>>> usage of a parameter. > >>>>> (Gogo::assign_connectivity): Likewise. > >>>>> (class Escape_analysis_tag): Likewise. > >>>>> (Gogo::tag_function): Likewise. > >>>>> * gofrontend/expressions.cc (Call_expression::do_type): > >>>>> Likewise. > >>>>> * gofrontend/gogo.h (class Gogo): Likewise. > >>>>> * gofrontend/types.cc (class Call_multiple_result_type): > >>>>> Likewise. (Type::make_call_multiple_result_type): Likewise. > >>>>> * gofrontend/types.h (class Type): Likewise. > >>>>> * gofrontend/wb.cc (class Check_escape): Likewise. > >>>>> (Gogo::add_write_barriers): Likewise. > >>>> Note that some of these may be used inside conditional code. For > >>>> example the add_AT_vms_delta is used by ia64-vms. You could > >>>> argue that ia64-vms is a zombie and should be removed, but the > >>>> general concern WRT conditionally compiled code holds. > >>> > >>> Well, please let me install the patch as is and if somebody will > >>> need the functionality, I would be happy to put it back. > >> > >> You could use contrib/config-list.mk to build all supported target > >> configs. You shouldn't break builds for valid configs > >> deliberately > > Right. On a suitably large box it only takes a few hours. Fire > > it off at the end of the day and you've got results in the morning. > > > > So how about this, if it passes config-list.mk then it's OK. > > Obviously it's OK to retain any functions that are flagged as > > necessary by config-list.mk. > > > > Alternately find + grep is your friend, but I find config-list.mk > > is better. > > > > jeff > > > > Ok, next time I would be more careful about testing of other targets. > > Thanks, > Martin Although not perfect, but may i suggest to consider putting the attached contrib/unused_functions.py into our tree? Just for fun i'm attaching output for fortran, c, cp as per the "Examples" comment in the header of the script. sample line for cp: gcc/cp/cvt.o: Symbol 'cp_get_callee_fndecl(tree_node*)' declared extern but never referenced externally sample for c: gcc/c/c-decl.o: Symbol 'pending_invalid_xref_location' declared extern but never referenced externally gcc/c/c-decl.o: Symbol 'pending_invalid_xref' declared extern but never referenced externally I may find time to take care of the fortran spots later on, fwiw. As per the comment inline, one could add support for extracting archive-members. This would allow to optionally put the script near the actual linking of e.g the compilers to see unwarranted extern symbols quickly. But OTOH maybe that's a bit too much. :) HTH PS: I have to admit that flagging unused fields is a nice thing. Does somebody know of an existing gcc plugin that does that? Or a secret LTO knob to track or flag these?