From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27517 invoked by alias); 23 May 2011 15:19:14 -0000 Received: (qmail 27498 invoked by uid 22791); 23 May 2011 15:19:12 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 15:18:56 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id E362493EE3 for ; Mon, 23 May 2011 17:18:54 +0200 (CEST) Date: Mon, 23 May 2011 15:54:00 -0000 From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH][last/n] LTO type merging cleanup Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 X-SW-Source: 2011-05/txt/msg01648.txt.bz2 This is the last (planned) bit for the regular type merging machinery (there is still some issues with TYPE_CANONICAL that I will try to address next). It avoids merging types which have different names as that leads to interesting debuginfo issues. LTO-bootstrapped and tested on x86_64-unknown-linux-gnu, SPEC 2k6 non--g built (w/o any but the TYPE_CANONICAL issues), SPEC 2k6 -g build running. Richard. 2011-05-23 Richard Guenther * gimple.c (gimple_types_compatible_p_1): Always compare type names. (iterative_hash_gimple_type): Always hash type names. Index: gcc/gimple.c =================================================================== *** gcc/gimple.c (revision 174065) --- gcc/gimple.c (working copy) *************** gimple_types_compatible_p_1 (tree t1, tr *** 3587,3592 **** --- 3587,3596 ---- SCCs this assumption may get revisited. */ state->u.same_p = 1; + /* The struct tags shall compare equal. */ + if (!compare_type_names_p (t1, t2, false)) + goto different_types; + /* If their attributes are not the same they can't be the same type. */ if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2))) goto different_types; *************** gimple_types_compatible_p_1 (tree t1, tr *** 3797,3806 **** { tree f1, f2; - /* The struct tags shall compare equal. */ - if (!compare_type_names_p (t1, t2, false)) - goto different_types; - /* For aggregate types, all the fields must be the same. */ for (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2); f1 && f2; --- 3801,3806 ---- *************** iterative_hash_gimple_type (tree type, h *** 4093,4099 **** smaller sets; when searching for existing matching types to merge, only existing types having the same features as the new type will be checked. */ ! v = iterative_hash_hashval_t (TREE_CODE (type), 0); v = iterative_hash_hashval_t (TYPE_QUALS (type), v); v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v); --- 4093,4100 ---- smaller sets; when searching for existing matching types to merge, only existing types having the same features as the new type will be checked. */ ! v = iterative_hash_name (TYPE_NAME (type), 0); ! v = iterative_hash_hashval_t (TREE_CODE (type), v); v = iterative_hash_hashval_t (TYPE_QUALS (type), v); v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v); *************** iterative_hash_gimple_type (tree type, h *** 4175,4182 **** unsigned nf; tree f; - v = iterative_hash_name (TYPE_NAME (type), v); - for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f)) { v = iterative_hash_name (DECL_NAME (f), v); --- 4176,4181 ----