From patchwork Mon May 27 17:53:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1940066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axis.com header.i=@axis.com header.a=rsa-sha256 header.s=selector1 header.b=Ggd3heiC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vp3Dc0PBmz20Pb for ; Tue, 28 May 2024 03:54:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B8AF384AB6D for ; Mon, 27 May 2024 17:54:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2074.outbound.protection.outlook.com [40.107.15.74]) by sourceware.org (Postfix) with ESMTPS id 8ABCF38708A5 for ; Mon, 27 May 2024 17:53:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8ABCF38708A5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8ABCF38708A5 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.74 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1716832422; cv=pass; b=lIMc/vZh6R4/BhRPUj18bZ4+HawBAONRMWtpozz+CJV162tNNPEHPzJorudBLLodswr4tXPG8zkDvW8H01KBoyMyEQTt7V5MlmZhVbPi3GKnQGeTmnUn9YiXf1t5XP425nhARnNCnow4hYckyFJy68QsMk6uNN7RvFx5yaO1AAA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1716832422; c=relaxed/simple; bh=+q4PuNfzIFc1PMQnVziC8PC09ObhePjY00PR+mko4QY=; h=DKIM-Signature:From:To:Subject:MIME-Version:Message-ID:Date; b=giMSLoKjk6Ri9ESMybpzYqTk/NNzypRoQSWbsCjOoYiN4v74Ev0+xgrqcStJlLoFIBEa6Ex0fBuR5P1U9SXQkPNmHlMhfGr06g3X0u9d7lrfMQFjtaBKuFnzDo5Kq9LWFQknuWawBQVqHMYUzBgY4KmEVt2bRUY+XEj0NloCQCE= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnEUzPJwSWIaTesHslBaG/9i7vpuOc/Kwif/e8VCE1uLBrfKv1b57dGKjkvlMwkpSpk0BEOAf7xE1c7lPqYPDz1MdK20k9SV3WUoFGKCmPR2/yrJQ7SYbg1fTi/4DZZ41zmdibh/f35PxrxBj8dKrbGaQFA7DjpfTd3DOyJ9iVQFWiyUQ6Yb6hzqVQRQ8loRVFKEamtMs4j9ifqlUuf4U6nuU5tYp0N7t/CsNR0amJo4qfdSrYy8d0Y6hAFYKXPptPgcOB5UcGcL3nxrrAIH1kJStp+WN/VkfaeX23P2iqkqtk+ceRowg2uRYGHrbU6yAQNcLcYgdlgqd/cepSOFVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VXwn1uuGllqzxIshiqMcqOs2c+P028pA6OeGg5/vr4o=; b=bpMTiGhwpTzh5A0UT3QcZjH+McRKmVGj7yP0gUL+dRNQ3Pi8Kg0WZ4R7G0lmrpKcyGJLCaVeINx9nj/CZ09bjhpT+u7kUs2VHZId9RA51UVAZXOhQDvc5oemoio6MmwUmlN8fv5p7gRelWGI+/by2esUttj+qRUKqA9gBGnly0YjZ39f3zdEvp9U+DtrbkgISrDvMKD3f10HNwE+xo++PzeE+PmT57ZwTkZBkoTd4eyJG4DZwA5T0DMmeI9zYdBmk+qhzBxn/5eJbgwIhmJb3w/p9CS0de9mM0lYxi2U2no+Rgd99vVfllYvfcsN9LVNm4QXJVeYurSLVd/OzcDDyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXwn1uuGllqzxIshiqMcqOs2c+P028pA6OeGg5/vr4o=; b=Ggd3heiCrpEL+OW8gKiXME2K6vVGRlVlPc87WNkCjC4/xNib5ZwWlO5az+UdsB+Q2jSaWrmyIRjP4u2vD4bUuUrQpgZou26tIoqM4a058hxROtG1mh2vyxLO/P2gd6FsIRXQvu/NsYS6XYnEQJu/fiCcUNhztqwnuDtRiKmaRe8= Received: from AM6P191CA0045.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::22) by PAVPR02MB10012.eurprd02.prod.outlook.com (2603:10a6:102:31f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 27 May 2024 17:53:37 +0000 Received: from AMS0EPF000001A7.eurprd05.prod.outlook.com (2603:10a6:209:7f:cafe::bc) by AM6P191CA0045.outlook.office365.com (2603:10a6:209:7f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29 via Frontend Transport; Mon, 27 May 2024 17:53:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by AMS0EPF000001A7.mail.protection.outlook.com (10.167.16.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 27 May 2024 17:53:36 +0000 Received: from SE-MAILARCH01W.axis.com (10.20.40.15) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 27 May 2024 19:53:36 +0200 Received: from se-mail02w.axis.com (10.20.40.8) by SE-MAILARCH01W.axis.com (10.20.40.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 27 May 2024 19:53:35 +0200 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 27 May 2024 19:53:35 +0200 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id ED0B39B6; Mon, 27 May 2024 19:53:35 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id E91D820433; Mon, 27 May 2024 19:53:35 +0200 (CEST) From: Hans-Peter Nilsson To: Subject: [PATCH 3/4] resource.cc (mark_target_live_regs): Remove check for bb not found MIME-Version: 1.0 Message-ID: <20240527175335.E91D820433@pchp3.se.axis.com> Date: Mon, 27 May 2024 19:53:35 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001A7:EE_|PAVPR02MB10012:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c22cdb4-d8b5-4be0-b9a3-08dc7e75ef08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?6YOru0gRvlhQjwzVnYJEba7tiy?= =?iso-8859-1?q?9pfxeQfhh7fW2YSbSDEZ2F2/LVs7fIGd8jPGhNePx1uudj6V8t45byNZP17k?= =?iso-8859-1?q?vMt8effUWXfQQbqdPXHOorhBvVlKVRK7z/veNjijd71tXTHrC9cALX31A5u6?= =?iso-8859-1?q?R45WZTCweBJN1RvNZzy39IG24AbikaFjqIu/ZTXAUkOg4JP/GPcwXhbJekJT?= =?iso-8859-1?q?TBacYVL9/i47LibNkfXi1bFxh1VYxrcCgAHgmOqPukxbMgvqfK/BTpu8Wyf9?= =?iso-8859-1?q?e0iYZ/8ELI4LqhdQZjyZ9qy1dI4fCKd0MPOuxCxgbafxGtoPSRyiKyVFg7RU?= =?iso-8859-1?q?C8mMpR23UacjsB9CcB1UGFm8g3n4fjtkOAqr4vJ9JU+ZvcsU9anFxVEjfPlz?= =?iso-8859-1?q?ZPgfTOx8j+q70iiMw/EekgKcgTEvobYPxxHk7RDq2og9Xg0+g40QajkUyRLA?= =?iso-8859-1?q?onl9SpGgIPvJfm80TbuMOi3b2E97y/ZZwQJEC5bWtF9u9StOAAZngKPWbmrP?= =?iso-8859-1?q?besDcBUMWTXHS+m6MOBr+h4lZoXxHYoKe+pOwlCMNOScr2TlA3FrRQ5bpH+K?= =?iso-8859-1?q?Zk+CUx+gJZ0HD6NmtMLb0/bVPDWkuVo5GhBL3sIDdAdac8JUyNGCEB2oC3rS?= =?iso-8859-1?q?zkNS9ljAaPwLmdRiB4CWMPQrdLrooKgE6hqNKtMyx1JNeM6GxY7ODmBfXrZ+?= =?iso-8859-1?q?alyHWrwnFtdoy55ix1lEHK5H2pIN5X05wjCKfedUxF2rgP4nFKipFei1V1Bt?= =?iso-8859-1?q?PV656QAi0V/rTZJy/hfDCyfGgfyxUikBamXYtDLZnzuMjaY5oFS66gjO2VnP?= =?iso-8859-1?q?p6OUt5zDWxHpeFumfaoN0y18v72y2KyC7twY3j5IBt3Xc6DBRkt55Jeo5u/P?= =?iso-8859-1?q?qMWqZ8UHOyPffpLTAb309xTNJ2KQDvVRBULq66PkzfIOixc8C1JIf8dZDx7t?= =?iso-8859-1?q?1dGdblfLyI0Q58RULEjk0XtsJTnq0YXkjxeX9YrasbHUcbNQHaDvENRuiRR8?= =?iso-8859-1?q?lb7sbUqmLmbjNccfqa8ticAlgsbt4X8CxQfg41bHrbMCfSkUy2iLwvvr7Hcz?= =?iso-8859-1?q?AB9eQxLoMib2TQVNWB9McmFc14PTYRMkmdwwdxwIElHeI7EsfQxYQPyHORRF?= =?iso-8859-1?q?e+s6/+RP+ZpMBpJwLLcfH0VXvc/d2Dd1ehYvDeqTl/R4VpV7Jo1GRMlK+tLh?= =?iso-8859-1?q?gumqpCj8Xn4pFjREg0XTz4IlyOvCGwOKTnGLzv3uV2QjoEYtauf5NmdgMTYf?= =?iso-8859-1?q?pRkmRTP1jag8BlK28fhIAyy0FByXasq6UmH1DqDG4Om4Zc9o+maXV8YMta+B?= =?iso-8859-1?q?piursKNT2ChrEc3wcGslr//SBq8MfSVn3TGT/nEk/GbKEehnA13i4i4gYXbM?= =?iso-8859-1?q?KJm4uIkaPj3uIIKYngOFjQQYtIy/e9GleFJusex67QfTb3+WB5e9YliUeLhE?= =?iso-8859-1?q?bj?= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 17:53:36.6055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c22cdb4-d8b5-4be0-b9a3-08dc7e75ef08 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001A7.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB10012 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Regtested cris-elf. Ok to commit? -- >8 -- No functional change. A "git diff -wb" (ignore whitespace diff) shows that this commit just removes a "if (b != -1)" after a "gcc_assert (b != -1)" and also removes the subsequent "else" clause. * resource.cc (mark_target_live_regs): Remove redundant check for b being -1, after gcc_assert. --- gcc/resource.cc | 270 +++++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 138 deletions(-) diff --git a/gcc/resource.cc b/gcc/resource.cc index 0d8cde93570e..62bd46f786eb 100644 --- a/gcc/resource.cc +++ b/gcc/resource.cc @@ -704,156 +704,150 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource CLEAR_HARD_REG_SET (pending_dead_regs); - /* If we found a basic block, get the live registers from it and update - them with anything set or killed between its start and the insn before - TARGET; this custom life analysis is really about registers so we need - to use the LR problem. Otherwise, we must assume everything is live. */ - if (b != -1) + /* Get the live registers from the basic block and update them with + anything set or killed between its start and the insn before + TARGET; this custom life analysis is really about registers so we + need to use the LR problem. Otherwise, we must assume everything + is live. */ + regset regs_live = DF_LR_IN (BASIC_BLOCK_FOR_FN (cfun, b)); + rtx_insn *start_insn, *stop_insn; + df_ref def; + + /* Compute hard regs live at start of block. */ + REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live); + FOR_EACH_ARTIFICIAL_DEF (def, b) + if (DF_REF_FLAGS (def) & DF_REF_AT_TOP) + SET_HARD_REG_BIT (current_live_regs, DF_REF_REGNO (def)); + + /* Get starting and ending insn, handling the case where each might + be a SEQUENCE. */ + start_insn = (b == ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb->index ? + insns : BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, b))); + stop_insn = target; + + if (NONJUMP_INSN_P (start_insn) + && GET_CODE (PATTERN (start_insn)) == SEQUENCE) + start_insn = as_a (PATTERN (start_insn))->insn (0); + + if (NONJUMP_INSN_P (stop_insn) + && GET_CODE (PATTERN (stop_insn)) == SEQUENCE) + stop_insn = next_insn (PREV_INSN (stop_insn)); + + for (insn = start_insn; insn != stop_insn; + insn = next_insn_no_annul (insn)) { - regset regs_live = DF_LR_IN (BASIC_BLOCK_FOR_FN (cfun, b)); - rtx_insn *start_insn, *stop_insn; - df_ref def; - - /* Compute hard regs live at start of block. */ - REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live); - FOR_EACH_ARTIFICIAL_DEF (def, b) - if (DF_REF_FLAGS (def) & DF_REF_AT_TOP) - SET_HARD_REG_BIT (current_live_regs, DF_REF_REGNO (def)); - - /* Get starting and ending insn, handling the case where each might - be a SEQUENCE. */ - start_insn = (b == ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb->index ? - insns : BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, b))); - stop_insn = target; - - if (NONJUMP_INSN_P (start_insn) - && GET_CODE (PATTERN (start_insn)) == SEQUENCE) - start_insn = as_a (PATTERN (start_insn))->insn (0); - - if (NONJUMP_INSN_P (stop_insn) - && GET_CODE (PATTERN (stop_insn)) == SEQUENCE) - stop_insn = next_insn (PREV_INSN (stop_insn)); - - for (insn = start_insn; insn != stop_insn; - insn = next_insn_no_annul (insn)) + rtx link; + rtx_insn *real_insn = insn; + enum rtx_code code = GET_CODE (insn); + + if (DEBUG_INSN_P (insn)) + continue; + + /* If this insn is from the target of a branch, it isn't going to + be used in the sequel. If it is used in both cases, this + test will not be true. */ + if ((code == INSN || code == JUMP_INSN || code == CALL_INSN) + && INSN_FROM_TARGET_P (insn)) + continue; + + /* If this insn is a USE made by update_block, we care about the + underlying insn. */ + if (code == INSN + && GET_CODE (PATTERN (insn)) == USE + && INSN_P (XEXP (PATTERN (insn), 0))) + real_insn = as_a (XEXP (PATTERN (insn), 0)); + + if (CALL_P (real_insn)) { - rtx link; - rtx_insn *real_insn = insn; - enum rtx_code code = GET_CODE (insn); - - if (DEBUG_INSN_P (insn)) - continue; - - /* If this insn is from the target of a branch, it isn't going to - be used in the sequel. If it is used in both cases, this - test will not be true. */ - if ((code == INSN || code == JUMP_INSN || code == CALL_INSN) - && INSN_FROM_TARGET_P (insn)) - continue; - - /* If this insn is a USE made by update_block, we care about the - underlying insn. */ - if (code == INSN - && GET_CODE (PATTERN (insn)) == USE - && INSN_P (XEXP (PATTERN (insn), 0))) - real_insn = as_a (XEXP (PATTERN (insn), 0)); - - if (CALL_P (real_insn)) + /* Values in call-clobbered registers survive a COND_EXEC CALL + if that is not executed; this matters for resoure use because + they may be used by a complementarily (or more strictly) + predicated instruction, or if the CALL is NORETURN. */ + if (GET_CODE (PATTERN (real_insn)) != COND_EXEC) { - /* Values in call-clobbered registers survive a COND_EXEC CALL - if that is not executed; this matters for resoure use because - they may be used by a complementarily (or more strictly) - predicated instruction, or if the CALL is NORETURN. */ - if (GET_CODE (PATTERN (real_insn)) != COND_EXEC) - { - HARD_REG_SET regs_invalidated_by_this_call - = insn_callee_abi (real_insn).full_reg_clobbers (); - /* CALL clobbers all call-used regs that aren't fixed except - sp, ap, and fp. Do this before setting the result of the - call live. */ - current_live_regs &= ~regs_invalidated_by_this_call; - } - - /* A CALL_INSN sets any global register live, since it may - have been modified by the call. */ - for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (global_regs[i]) - SET_HARD_REG_BIT (current_live_regs, i); + HARD_REG_SET regs_invalidated_by_this_call + = insn_callee_abi (real_insn).full_reg_clobbers (); + /* CALL clobbers all call-used regs that aren't fixed except + sp, ap, and fp. Do this before setting the result of the + call live. */ + current_live_regs &= ~regs_invalidated_by_this_call; } - /* Mark anything killed in an insn to be deadened at the next - label. Ignore USE insns; the only REG_DEAD notes will be for - parameters. But they might be early. A CALL_INSN will usually - clobber registers used for parameters. It isn't worth bothering - with the unlikely case when it won't. */ - if ((NONJUMP_INSN_P (real_insn) - && GET_CODE (PATTERN (real_insn)) != USE - && GET_CODE (PATTERN (real_insn)) != CLOBBER) - || JUMP_P (real_insn) - || CALL_P (real_insn)) - { - for (link = REG_NOTES (real_insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_DEAD - && REG_P (XEXP (link, 0)) - && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) - add_to_hard_reg_set (&pending_dead_regs, - GET_MODE (XEXP (link, 0)), - REGNO (XEXP (link, 0))); - - note_stores (real_insn, update_live_status, NULL); - - /* If any registers were unused after this insn, kill them. - These notes will always be accurate. */ - for (link = REG_NOTES (real_insn); link; link = XEXP (link, 1)) - if (REG_NOTE_KIND (link) == REG_UNUSED - && REG_P (XEXP (link, 0)) - && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) - remove_from_hard_reg_set (¤t_live_regs, - GET_MODE (XEXP (link, 0)), - REGNO (XEXP (link, 0))); - } + /* A CALL_INSN sets any global register live, since it may + have been modified by the call. */ + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (global_regs[i]) + SET_HARD_REG_BIT (current_live_regs, i); + } + + /* Mark anything killed in an insn to be deadened at the next + label. Ignore USE insns; the only REG_DEAD notes will be for + parameters. But they might be early. A CALL_INSN will usually + clobber registers used for parameters. It isn't worth bothering + with the unlikely case when it won't. */ + if ((NONJUMP_INSN_P (real_insn) + && GET_CODE (PATTERN (real_insn)) != USE + && GET_CODE (PATTERN (real_insn)) != CLOBBER) + || JUMP_P (real_insn) + || CALL_P (real_insn)) + { + for (link = REG_NOTES (real_insn); link; link = XEXP (link, 1)) + if (REG_NOTE_KIND (link) == REG_DEAD + && REG_P (XEXP (link, 0)) + && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) + add_to_hard_reg_set (&pending_dead_regs, + GET_MODE (XEXP (link, 0)), + REGNO (XEXP (link, 0))); + + note_stores (real_insn, update_live_status, NULL); + + /* If any registers were unused after this insn, kill them. + These notes will always be accurate. */ + for (link = REG_NOTES (real_insn); link; link = XEXP (link, 1)) + if (REG_NOTE_KIND (link) == REG_UNUSED + && REG_P (XEXP (link, 0)) + && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) + remove_from_hard_reg_set (¤t_live_regs, + GET_MODE (XEXP (link, 0)), + REGNO (XEXP (link, 0))); + } - else if (LABEL_P (real_insn)) + else if (LABEL_P (real_insn)) + { + basic_block bb; + + /* A label clobbers the pending dead registers since neither + reload nor jump will propagate a value across a label. */ + current_live_regs &= ~pending_dead_regs; + CLEAR_HARD_REG_SET (pending_dead_regs); + + /* We must conservatively assume that all registers that used + to be live here still are. The fallthrough edge may have + left a live register uninitialized. */ + bb = BLOCK_FOR_INSN (real_insn); + if (bb) { - basic_block bb; - - /* A label clobbers the pending dead registers since neither - reload nor jump will propagate a value across a label. */ - current_live_regs &= ~pending_dead_regs; - CLEAR_HARD_REG_SET (pending_dead_regs); - - /* We must conservatively assume that all registers that used - to be live here still are. The fallthrough edge may have - left a live register uninitialized. */ - bb = BLOCK_FOR_INSN (real_insn); - if (bb) - { - HARD_REG_SET extra_live; + HARD_REG_SET extra_live; - REG_SET_TO_HARD_REG_SET (extra_live, DF_LR_IN (bb)); - current_live_regs |= extra_live; - } + REG_SET_TO_HARD_REG_SET (extra_live, DF_LR_IN (bb)); + current_live_regs |= extra_live; } - - /* The beginning of the epilogue corresponds to the end of the - RTL chain when there are no epilogue insns. Certain resources - are implicitly required at that point. */ - else if (NOTE_P (real_insn) - && NOTE_KIND (real_insn) == NOTE_INSN_EPILOGUE_BEG) - current_live_regs |= start_of_epilogue_needs.regs; } - res->regs = current_live_regs; - if (tinfo != NULL) - { - tinfo->block = b; - tinfo->bb_tick = bb_ticks[b]; - } + /* The beginning of the epilogue corresponds to the end of the + RTL chain when there are no epilogue insns. Certain resources + are implicitly required at that point. */ + else if (NOTE_P (real_insn) + && NOTE_KIND (real_insn) == NOTE_INSN_EPILOGUE_BEG) + current_live_regs |= start_of_epilogue_needs.regs; + } + + res->regs = current_live_regs; + if (tinfo != NULL) + { + tinfo->block = b; + tinfo->bb_tick = bb_ticks[b]; } - else - /* We didn't find the start of a basic block. Assume everything - in use. This should happen only extremely rarely. */ - SET_HARD_REG_SET (res->regs); if (tinfo != NULL) tinfo->live_regs = res->regs;