From patchwork Wed Feb 25 17:30:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 443564 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F321E14008F for ; Thu, 26 Feb 2015 04:31:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ZUlrT4gs; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=icsnmDeD+GcudjRURjf/qgBzupQVmEjG3PD90Ma2AKY E9ydF+QtIBPfGotQ1YJDthH/wjmihIauPYQf4MqjYZXYzTSZHdZ5itdkfDxI3JNs Hwu6gpyEV5maiwr9bdfrcqa5GC4NlrXXiM+nRT2sBQXJT0vuvubHwhXlxjZiA//A = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=OAqGrbVvDsgmLOMDBEUoZr0biO4=; b=ZUlrT4gsbSPvOUyhJ NdAyEU/l/jfWBMwhia6iOiBf7Y+rb9ldP3JLri3OEA+g2N6PSPQlgjstbToDOXRC HgCDo0X8PenYXHjYmdl/Z+pgNrWhCcxTRczJsE77X2/8VIozcqcSYBK/2TQ5VDT6 zkepCVu0+nvw9tH9h0gl/gLyYY= Received: (qmail 112234 invoked by alias); 25 Feb 2015 17:31:01 -0000 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 Received: (qmail 112212 invoked by uid 89); 25 Feb 2015 17:30:59 -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 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 25 Feb 2015 17:30:59 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9FC0EAB0C; Wed, 25 Feb 2015 17:30:55 +0000 (UTC) Message-ID: <54EE06CF.6030303@suse.cz> Date: Wed, 25 Feb 2015 18:30:55 +0100 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Jan Hubicka Subject: [PATCH] ICF: handle correctly hard register variables X-IsSubscribed: yes Hello. This patch adds support for hard register variables in ICF and it's pre-approved by Honza, I'm going to install the patch. No regressing on x86_64-linux-pc. Thanks, Martin From eff93050904e0aeaf26b47fb1d1e8eeb803f9af6 Mon Sep 17 00:00:00 2001 From: mliska Date: Wed, 25 Feb 2015 18:26:09 +0100 Subject: [PATCH] ICF: Validate correctly hard register variables. gcc/ChangeLog: 2015-02-25 Martin Liska * ipa-icf-gimple.c (func_checker::compare_variable_decl): Compare hard register variables. --- gcc/ipa-icf-gimple.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 5b176d0..53d2c38 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -575,6 +575,13 @@ func_checker::compare_variable_decl (tree t1, tree t2) if (t1 == t2) return true; + if (DECL_HARD_REGISTER (t1) != DECL_HARD_REGISTER (t2)) + return return_false_with_msg ("DECL_HARD_REGISTER are different"); + + if (DECL_HARD_REGISTER (t1) + && DECL_ASSEMBLER_NAME (t1) != DECL_ASSEMBLER_NAME (t2)) + return return_false_with_msg ("HARD REGISTERS are different"); + if (TREE_CODE (t1) == VAR_DECL && (DECL_EXTERNAL (t1) || TREE_STATIC (t1))) { symtab_node *n1 = symtab_node::get (t1); -- 2.1.2