From patchwork Thu Mar 31 01:16:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Matz X-Patchwork-Id: 88999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7441AB6F74 for ; Thu, 31 Mar 2011 12:17:11 +1100 (EST) Received: (qmail 27218 invoked by alias); 31 Mar 2011 01:17:10 -0000 Received: (qmail 27210 invoked by uid 22791); 31 Mar 2011 01:17:09 -0000 X-SWARE-Spam-Status: No, hits=-5.6 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; Thu, 31 Mar 2011 01:17:01 +0000 Received: from relay1.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 76F708E8CC for ; Thu, 31 Mar 2011 03:16:59 +0200 (CEST) Date: Thu, 31 Mar 2011 03:16:59 +0200 (CEST) From: Michael Matz To: gcc-patches@gcc.gnu.org Subject: Random cleanups [1/4] Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, in order to reduce the size of my LTO early-merging patch I'll post some cleanups separately. This one removes two functions that are not called from anywhere and makes not allocate priority structs for all decls that set them only to the DEFAULT_INIT_PRIORITY. Regstrapped on x86_64-linux together with the next three cleanup patches. Okay for trunk? Ciao, Michael. Index: tree.c =================================================================== --- tree.c (revision 171537) +++ tree.c (working copy) @@ -5913,6 +5920,8 @@ decl_init_priority_insert (tree decl, pr struct tree_priority_map *h; gcc_assert (VAR_OR_FUNCTION_DECL_P (decl)); + if (priority == DEFAULT_INIT_PRIORITY) + return; h = decl_priority_info (decl); h->init = priority; } @@ -5925,6 +5934,8 @@ decl_fini_priority_insert (tree decl, pr struct tree_priority_map *h; gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); + if (priority == DEFAULT_INIT_PRIORITY) + return; h = decl_priority_info (decl); h->fini = priority; } @@ -9893,50 +9904,6 @@ needs_to_live_in_memory (const_tree t) && aggregate_value_p (t, current_function_decl))); } -/* There are situations in which a language considers record types - compatible which have different field lists. Decide if two fields - are compatible. It is assumed that the parent records are compatible. */ - -bool -fields_compatible_p (const_tree f1, const_tree f2) -{ - if (!operand_equal_p (DECL_FIELD_BIT_OFFSET (f1), - DECL_FIELD_BIT_OFFSET (f2), OEP_ONLY_CONST)) - return false; - - if (!operand_equal_p (DECL_FIELD_OFFSET (f1), - DECL_FIELD_OFFSET (f2), OEP_ONLY_CONST)) - return false; - - if (!types_compatible_p (TREE_TYPE (f1), TREE_TYPE (f2))) - return false; - - return true; -} - -/* Locate within RECORD a field that is compatible with ORIG_FIELD. */ - -tree -find_compatible_field (tree record, tree orig_field) -{ - tree f; - - for (f = TYPE_FIELDS (record); f ; f = TREE_CHAIN (f)) - if (TREE_CODE (f) == FIELD_DECL - && fields_compatible_p (f, orig_field)) - return f; - - /* ??? Why isn't this on the main fields list? */ - f = TYPE_VFIELD (record); - if (f && TREE_CODE (f) == FIELD_DECL - && fields_compatible_p (f, orig_field)) - return f; - - /* ??? We should abort here, but Java appears to do Bad Things - with inherited fields. */ - return orig_field; -} - /* Return value of a constant X and sign-extend it. */ HOST_WIDE_INT Index: tree.h =================================================================== --- tree.h (revision 171537) +++ tree.h (working copy) @@ -5227,9 +5232,6 @@ extern bool subrange_type_for_debug_p (c extern HOST_WIDE_INT int_cst_value (const_tree); extern HOST_WIDEST_INT widest_int_cst_value (const_tree); -extern bool fields_compatible_p (const_tree, const_tree); -extern tree find_compatible_field (tree, tree); - extern tree *tree_block (tree); extern location_t *block_nonartificial_location (tree); extern location_t tree_nonartificial_location (tree); Index: gimple.c =================================================================== --- gimple.c.orig 2011-03-28 03:55:39.000000000 +0200 +++ gimple.c 2011-03-28 03:56:13.000000000 +0200 @@ -3306,8 +3306,7 @@ compare_type_names_p (tree t1, tree t2, /* Return true if the field decls F1 and F2 are at the same offset. - This is intended to be used on GIMPLE types only. In order to - compare GENERIC types, use fields_compatible_p instead. */ + This is intended to be used on GIMPLE types only. */ bool gimple_compare_field_offset (tree f1, tree f2)