From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13149 invoked by alias); 15 Jul 2009 10:54:42 -0000 Received: (qmail 13093 invoked by uid 48); 15 Jul 2009 10:54:29 -0000 Date: Wed, 15 Jul 2009 10:54:00 -0000 Message-ID: <20090715105429.13092.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug lto/40758] [LTO] ICE in partition_view_bitmap, at tree-ssa-live.c:331 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-07/txt/msg01264.txt.bz2 ------- Comment #2 from rguenth at gcc dot gnu dot org 2009-07-15 10:54 ------- For me ./xgcc -B. -shared ice.o -flto takes ages because iterative_hash_gimple_type seems to be exponential in time!? Called from gimple_register_type on > QI size unit size align 8 symtab 0 alias set -1 canonical type 0xb7becc40 arg-types chain chain chain chain chain >>>>> pointer_to_this > unsigned SI size constant 32> unit size constant 4> align 32 symtab 0 alias set -1 canonical type 0xb7beccb0> I guess we should try hashing without duplicates or store the hash somewhere... I cannot reproduce the ICE btw. A patch to fix the slowness would be Index: gimple.c =================================================================== --- gimple.c (revision 149668) +++ gimple.c (working copy) @@ -3537,13 +3537,17 @@ gimple_types_compatible_p (tree t1, tree return same_p; } - /* Returning a hash value for gimple type TYPE combined with VAL. */ static hashval_t iterative_hash_gimple_type (const_tree type, hashval_t val, unsigned level) { hashval_t v; + void **slot; + + if ((slot = pointer_map_contains (type_hash_cache, type)) != NULL) + return iterative_hash_hashval_t (TREE_ADDRESSABLE (type), + (hashval_t) (size_t) *slot); /* Combine a few common features of types so that types are grouped into smaller sets; when searching for existing matching types to merge, @@ -3604,6 +3608,8 @@ iterative_hash_gimple_type (const_tree t v = iterative_hash_hashval_t (nf, v); } + *pointer_map_insert (type_hash_cache, type) = (void *) (size_t) v; + return v; } @@ -3620,28 +3626,13 @@ static hashval_t gimple_type_hash (const void *p) { const_tree type; - void **slot; - hashval_t v; type = (const_tree) p; if (type_hash_cache == NULL) - { - type_hash_cache = pointer_map_create (); - slot = NULL; - } - else - slot = pointer_map_contains (type_hash_cache, type); + type_hash_cache = pointer_map_create (); - if (slot) - v = (hashval_t) (size_t) *slot; - else - { - v = iterative_hash_gimple_type (type, 0, 0); - *pointer_map_insert (type_hash_cache, type) = (void *) (size_t) v; - } - - return v; + return iterative_hash_gimple_type (type, 0, 0); } I am going to bootstrap and test a variant of that. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40758