From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115445 invoked by alias); 26 Jun 2015 13:38:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115432 invoked by uid 89); 26 Jun 2015 13:38:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp-relay.CeBiTec.Uni-Bielefeld.DE Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Jun 2015 13:38:08 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 9E4AB9FE; Fri, 26 Jun 2015 15:38:04 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7vwyhABBJa-H; Fri, 26 Jun 2015 15:37:58 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 94EA99FA; Fri, 26 Jun 2015 15:37:58 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.1+Sun/8.15.1/Submit) id t5QDbvdh004100; Fri, 26 Jun 2015 15:37:57 +0200 (CEST) From: Rainer Orth To: Jeff Law Cc: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Re: [12/12] Simplify uses of hash_map References: <87egl2bicm.fsf@e105548-lin.cambridge.arm.com> <87twty8ob7.fsf@e105548-lin.cambridge.arm.com> <558C3091.5050607@redhat.com> Date: Fri, 26 Jun 2015 13:50:00 -0000 In-Reply-To: <558C3091.5050607@redhat.com> (Jeff Law's message of "Thu, 25 Jun 2015 10:47:13 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg01955.txt.bz2 Jeff Law writes: > On 06/23/2015 08:57 AM, Richard Sandiford wrote: >> At this point all hash_map traits know what kind of key they're >> dealing with, so we can make that a traits typedef, like it is for >> hash_table traits. Then, if we make the default hash traits for >> T be T, we can use hash_table-style traits as the first template >> parameter to hash_map, without the need for a third. That is, if >> foo_hash hashes elements of type foo_type: >> >> typedef simple_hashmap_traits foo_traits; >> hash_map x; >> >> becomes just: >> >> hash_map x; >> >> just like a hash_table of foo_types would be: >> >> hash_table y; >> >> This patch makes that simplification. >> >> >> gcc/ >> * hash-map-traits.h (simple_hashmap_traits::key_type): New typedef. >> (unbounded_int_hashmap_traits::key_type): Likewise. >> * hash-map.h (hash_map): Get the key type from the traits. >> * hash-traits.h (default_hash_traits): By default, inherit from the >> template parameter. >> * alias.c (alias_set_traits): Delete. >> (alias_set_entry_d::children): Use alias_set_hash as the first >> template parameter. >> (record_alias_subset): Update accordingly. >> * except.c (tree_hash_traits): Delete. >> (type_to_runtime_map): Use tree_hash as the first template parameter. >> (init_eh): Update accordingly. >> * genmatch.c (capture_id_map_hasher): Delete. >> (cid_map_t): Use nofree_string_hash as first template parameter. >> * ipa-icf.h (symbol_compare_hashmap_traits): Delete. >> * ipa-icf.c (sem_item_optimizer::subdivide_classes_by_sensitive_refs): >> Use symbol_compare_hash as the first template parameter in >> subdivide_hash_map. >> * mem-stats.h (mem_usage_pair::mem_alloc_hashmap_traits): Delete. >> (mem_usage_pair::mem_map_t): Use mem_location_hash as the first >> template parameter. >> * passes.c (pass_registry_hasher): Delete. >> (name_to_pass_map): Use nofree_string_hash as the first template >> parameter. >> (register_pass_name): Update accordingly. >> * sanopt.c (sanopt_tree_map_traits): Delete. >> (sanopt_tree_triplet_map_traits): Delete. >> (sanopt_ctx::asan_check_map): Use tree_operand_hash as the first >> template parameter. >> (sanopt_ctx::vptr_check_map): Use sanopt_tree_triplet_hash as >> the first template parameter. >> * sese.c (rename_map_hasher): Delete. >> (rename_map_type): Use tree_ssa_name_hash as the first template >> parameter. >> * symbol-summary.h (function_summary::summary_hashmap_traits): Delete. >> (function_summary::m_map): Use map_hash as the first template >> parameter. >> (function_summary::release): Update accordingly. >> * tree-if-conv.c (phi_args_hash_traits): Delete. >> (predicate_scalar_phi): Use tree_operand_hash as the first template >> parameter to phi_arg_map. >> * tree-inline.h (dependence_hasher): Delete. >> (copy_body_data::dependence_map): Use dependence_hash as the first >> template parameter. >> * tree-inline.c (remap_dependence_clique): Update accordingly. >> * tree-ssa-strlen.c (stridxlist_hash_traits): Delete. >> (decl_to_stridxlist_htab): Use tree_decl_hash as the first template >> parameter. >> (addr_stridxptr): Update accordingly. >> * value-prof.c (profile_id_traits): Delete. >> (cgraph_node_map): Use profile_id_hash as the first template >> parameter. >> (init_node_map): Update accordingly. >> * config/alpha/alpha.c (string_traits): Delete. >> (machine_function::links): Use nofree_string_hash as the first >> template parameter. >> (alpha_use_linkage, alpha_write_linkage): Update accordingly. >> * config/m32c/m32c.c (pragma_traits): Delete. >> (pragma_htab): Use nofree_string_hash as the first template parameter. >> (m32c_note_pragma_address): Update accordingly. >> * config/mep/mep.c (pragma_traits): Delete. >> (pragma_htab): Use nofree_string_hash as the first template parameter. >> (mep_note_pragma_flag): Update accordingly. >> * config/mips/mips.c (mips16_flip_traits): Delete. >> (mflip_mips16_htab): Use nofree_string_hash as the first template >> parameter. >> (mflip_mips16_use_mips16_p): Update accordingly. >> (local_alias_traits): Delete. >> (mips16_local_aliases): Use nofree_string_hash as the first template >> parameter. >> (mips16_local_alias): Update accordingly. > Phew. OK. According to a reghunt, this patch broke bootstrap (at least with g++ 4.7 as bootstrap compiler): /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c: In function 'void build_wrapper_type(wrapper_data*)': /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:436:77: error: no matching function for call to 'hash_map::traverse(auto_vec*)' /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:436:77: note: candidates are: In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, const Value&, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:436:77: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node* const&, auto_vec*)' In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, Value*, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:436:77: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node**, auto_vec*)' /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c: In function 'void cilk_outline(tree, tree_node**, void*)': /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:540:77: error: no matching function for call to 'hash_map::traverse(auto_vec*)' /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:540:77: note: candidates are: In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, const Value&, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:540:77: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node* const&, auto_vec*)' In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, Value*, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:540:77: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node**, auto_vec*)' /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c: In function 'tree_node* create_cilk_wrapper(tree, tree_node**)': /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:747:76: error: no matching function for call to 'hash_map::traverse(auto_vec*)' /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:747:76: note: candidates are: In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, const Value&, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:173:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:747:76: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node* const&, auto_vec*)' In file included from /vol/gcc/src/hg/trunk/local/gcc/hash-table.h:553:0, from /vol/gcc/src/hg/trunk/local/gcc/coretypes.h:317, from /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:25: /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template void hash_map::traverse(Arg) const [with Arg = Arg; bool (* f)(typename Traits::key_type&, Value*, Arg) = f; KeyId = tree_node*; Value = tree_node*; Traits = simple_hashmap_traits >] /vol/gcc/src/hg/trunk/local/gcc/hash-map.h:181:8: note: template argument deduction/substitution failed: /vol/gcc/src/hg/trunk/local/gcc/c-family/cilk.c:747:76: error: could not convert template argument 'fill_decls_vec' to 'bool (*)(tree_node*&, tree_node**, auto_vec*)' make: *** [c-family/cilk.o] Error 1 Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University