From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75238 invoked by alias); 16 Oct 2015 03:12:41 -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 75223 invoked by uid 89); 16 Oct 2015 03:12:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 16 Oct 2015 03:12:39 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 21F2C541B79; Fri, 16 Oct 2015 05:12:35 +0200 (CEST) Date: Fri, 16 Oct 2015 03:12:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Drop CONSTRUCTOR comparsion from ipa-icf-gimple Message-ID: <20151016031234.GC45365@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-10/txt/msg01530.txt.bz2 Hi, as Richard noticed in my port of the code to operand_equal_p, the checking of CONSTURCTOR in ipa-icf-gimple is incomplete missing the index checks. It is also unnecesary since non-empty ctors does not happen as gimple operands. This patch thus removes the unnecesary code. Bootstrapped/regtested x86_64-linux, comitted. Honza * ipa-icf-gimple.c (func_checker::compare_operand): Compare only empty constructors. Index: ipa-icf-gimple.c =================================================================== --- ipa-icf-gimple.c (revision 228851) +++ ipa-icf-gimple.c (working copy) @@ -415,20 +415,9 @@ func_checker::compare_operand (tree t1, switch (TREE_CODE (t1)) { case CONSTRUCTOR: - { - unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1)); - unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2)); - - if (length1 != length2) - return return_false (); - - for (unsigned i = 0; i < length1; i++) - if (!compare_operand (CONSTRUCTOR_ELT (t1, i)->value, - CONSTRUCTOR_ELT (t2, i)->value)) - return return_false(); - - return true; - } + gcc_assert (!vec_safe_length (CONSTRUCTOR_ELTS (t1)) + && !vec_safe_length (CONSTRUCTOR_ELTS (t2))); + return true; case ARRAY_REF: case ARRAY_RANGE_REF: /* First argument is the array, second is the index. */