> It seems like we're likely to need the same thing when we get to > make_decl_one_only by other paths; perhaps we should put this > recalculation in a cxx_make_decl_one_only.
There are 4 calls to make_decl_one_only in the cp/ directory: the one at stake here in comdat_linkage, 1 in maybe_make_one_only, 1 in get_guard and 1 in get_tls_init_fn. The last 2 don't need the recalculation, especially the 3rd one which makes a copy of the TLS model. There are 3 calls to maybe_make_one_only in the cp/directory: 1 from start_preparsed_function, 1 from mark_decl_instantiated and 1 one from import_export_decl but guarded by DECL_FUNCTION_MEMBER_P. The 1st and 3rd don't need the recalculation. So it isn't clear to me if a cxx_make_decl_one_only is the way to go. Maybe doing the recalculation in comdat_linkage and maybe_make_one_only only would be sufficient. -- Eric Botcazou