From patchwork Thu Jun 19 16:07:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 361917 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 6AE2B14008B for ; Fri, 20 Jun 2014 02:07:34 +1000 (EST) 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=x+ZI3XEL1cqpCZjrU/scfl2czVNvUs8uXzQT4CVcnNA Aslmoy+3gJvuCR24Vvk44H1Kx0+FfN43YUdQUHBqfvbGslTqUz5X1aKzgGihwzMa Jz1HpQHXQCAeSq4MZAyviigHejjJwMlPMQEPzFJusOz3IGGK/ypvxhqkJrjcnTUU = 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=E0mySZ3C9cidHwmNSWRP48iB8qo=; b=h2sUaTT2jOO4B8kei P8J8wgB+OhTvT9aGyolfMPBBO3/3Z4StqIgoR4ChjKay5sV/TEOhCS89K52Veys5 kVJxXbhBj7HiQYxFsRugJqqrYyB03hdD0DcjMCjw6lRsZAzLpo14s4Ie5bAs3csm uP3I8GTpuK01ew1z5KB1RecQE0= Received: (qmail 30566 invoked by alias); 19 Jun 2014 16:07:27 -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 30551 invoked by uid 89); 19 Jun 2014 16:07:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Jun 2014 16:07:26 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Wxerz-0007I8-3V from Tom_deVries@mentor.com ; Thu, 19 Jun 2014 09:07:23 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 Jun 2014 09:07:22 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 19 Jun 2014 17:07:21 +0100 Message-ID: <53A30AB7.1060800@mentor.com> Date: Thu, 19 Jun 2014 18:07:19 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Richard Henderson CC: GCC Patches Subject: Fix finding reg-sets of call insn in collect_fn_hard_reg_usage Richard, atm the moment, when processing a call in collect_fn_hard_reg_usage, we get the used regs from the callee, but forget to register the regs in the call insn itself (ouch). This patch fixes this by introducing an extra IOR_HARD_REG_SET. We also switch the order of find_all_hard_reg_sets and get_call_reg_set_usage. There's no point in doing find_all_hard_reg_sets on a call if get_call_reg_set_usage returns false. OK for trunk if bootstrap and reg-test on x86_64 is ok ? Thanks, - Tom 2014-06-19 Tom de Vries * final.c (collect_fn_hard_reg_usage): Add separate IOR_HARD_REG_SET for get_call_reg_set_usage. diff --git a/gcc/final.c b/gcc/final.c index e67e84b..bbeb50d 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -4775,12 +4775,16 @@ collect_fn_hard_reg_usage (void) if (!NONDEBUG_INSN_P (insn)) continue; - find_all_hard_reg_sets (insn, &insn_used_regs, false); + if (CALL_P (insn)) + { + if (!get_call_reg_set_usage (insn, &insn_used_regs, + call_used_reg_set)) + return; - if (CALL_P (insn) - && !get_call_reg_set_usage (insn, &insn_used_regs, call_used_reg_set)) - return; + IOR_HARD_REG_SET (function_used_regs, insn_used_regs); + } + find_all_hard_reg_sets (insn, &insn_used_regs, false); IOR_HARD_REG_SET (function_used_regs, insn_used_regs); } -- 1.9.1