From patchwork Fri Oct 20 06:09:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 155819 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp853335vqb; Thu, 19 Oct 2023 23:10:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHsFX3DKUqwtUSb3xqIioxhwnRVLQIF0un/F1H4o3aJgVE6/ZyGNLPt5Y1BR8f+pckLnsh X-Received: by 2002:a81:7143:0:b0:595:89b0:6b56 with SMTP id m64-20020a817143000000b0059589b06b56mr968592ywc.28.1697782216055; Thu, 19 Oct 2023 23:10:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697782216; cv=pass; d=google.com; s=arc-20160816; b=b8g8ShOtSN1keuSlNHy/+En39NYQ4cr8hebOADn/YTxjR9Zt88ZrKhnW8dMGBqWsHm YzO3hnr67yUyZ31Iev2kveEIV/Iu1QvheJos0SQNnMLZV4IobgY3jR0TM+bkKfsT1E0n aWeekUKXoRPMQLJ5+j6B72RP9Ig3j+KQa0or4dIMX/IExmhFUvyk5gZxqDgniZcT4uX0 idzBi6WF0BX0DgBZwPcrVk+2QTZf2nbKkXy50hmFPmqU2/r3AOn5tfpX6EV8dqv4wJma jdgkmZEzf3Xx5bk0OD3E0CDtZRo3cnl1s6iCLnsa1TZ9+ahWY2cGWzJA3HPBJppFQmLQ CpYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:in-reply-to:date:references:organization:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=rCSfwZFggXrf3cU+PiAkukcTB1pyay3jX0EQcoN5CYY=; fh=x984jQnJ112xSe6rV5yK+CjNGAqv6p4VeoDFvkYQNo0=; b=RxghX3Ap5ozFN4nFSeX5L8/q+R+5+2n7aegdyPuznLhYL/UP161u2MhkwFLl2+FoFM xMXwXKy+q+3znZf38y20Fcuwi5hoZajBCkwIEoHkHYyTEsY+OyjGraG5Y/9TfqnBadTD lnlaho8Rkh+2Qrnt3BM8EJJuDhzu3jfotxdWCFqeXSj63VCUXVccQ07ZQ7lZ/ktlAqJe 8vVGYtdfpC64T3P0Ht5tCUyit55UNy9Ow4fzODdOSKkWm9/GpPYKU+7fwPM/axwlxaRU p0PWKTGfXpXFJg7hzpy7ApjG5S5fGo3sk55/AKx9WhebO/B89cgQM3LbsvUsJk38nIPn +AGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=ZUeVvU3n; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u13-20020a0ced2d000000b0065b240236c1si875603qvq.403.2023.10.19.23.10.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 23:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=ZUeVvU3n; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5B9A385843E for ; Fri, 20 Oct 2023 06:10:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 005843858D33 for ; Fri, 20 Oct 2023 06:09:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 005843858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 005843858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697782192; cv=none; b=AmTXAm/e399hSDe1IfmA8d/K6oRLdJtVugrFvImOjxF5MAdXKI7VEsQHAnQdc7CcyN3gc84hl3ApVT+E70aL2XvWxTGzOl68VQqxPFOADMQgYaDkW+2OjNMSyqzZc8Aby7GBjB4m7qGibAqu5+Pze0d5zevneP+wh0K12F/Jiyw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697782192; c=relaxed/simple; bh=ShH71dywzuMRKjB6XMuaoz3WVusYbTLfQSe8E1bktmU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=VitaukCq+bH3LKE0n0OIj1oBmVOTP+vSaTax/YrTnilEqi2MeOymzIb/8kHLbDyyGsv2vwriziktKCdqVOzWUXJRcY8iiWWvGYRS8+BnDxBO7o+W72+LbPLf7JRw5j33hClrxfAwYFPOxu7dEvsW+yAY2AdKBrUzHUF0bPKoRHA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b89ab5ddb7so471034b3a.0 for ; Thu, 19 Oct 2023 23:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1697782190; x=1698386990; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rCSfwZFggXrf3cU+PiAkukcTB1pyay3jX0EQcoN5CYY=; b=ZUeVvU3nbIoPeyBOhafHac6miA/+m+UzHsL5T7z3iQ1Tm9hYKPf4PVJhK/chC7uwDT SVC7fRmS5QYjHPqx8AV5+LBxPKeK1y/N6gY1OxB+3FaASZq4rBhtKKEnubywDPstGKWY huWeCNSjJmzjXCAZmVapJzESzkthT5Y3oSdhUHTMbrwB3uPvFim7V4X0EsrbvWTDnBqq gsfeJ/Gf8RJx+cM51CyL09su66MJMLHVlkQtIFzoTbZGudz132KhslnwAY1Va4xJfMbN 4S+0Hg1MTsM51k0FTCJ4P9ZNIPBbtYtTwLi01OCXiZ4K28BIYHWTNWCoOU0Nz34HLm2e ORSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697782190; x=1698386990; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rCSfwZFggXrf3cU+PiAkukcTB1pyay3jX0EQcoN5CYY=; b=l4S2C1ROQFFdq8MHz1gl+RLRuOiY5JNXW0G1/rD6myDaEle2e1WU2uAMwS3BuNsw0n vaGRCILwyV/cUi59K3AXOi7csL08nPB3Ho04Bfx1erfIXt+N/LJILZ7zXsfjobyZ/O0Y OQNq8FiIS5dBZugHjAbdCoT+tR7sCl2xc3+ElSk0YGbGlXs/InF4yWm/+GHGumxxWek1 7EKYeowSe4hUXK0Kao0broT73Z9eLIonu/Z6ULLcYSK6+nj9Ul7Qyti+iProm00ONolK mH+Z0SoJOrNTQyhGxi3EJXLnUI9A3lIIPXMvop58G+vbT+w1WxwYlcDWYPZac6si5NJt m51A== X-Gm-Message-State: AOJu0YxIoslp594l56XwZHGDrMSuZngf6HAu7reOpi9fDH/5bKJPG6uR fc0i/toudigGRIyjEZ2lDR1Xvw== X-Received: by 2002:a05:6a00:1488:b0:68a:54e5:24e6 with SMTP id v8-20020a056a00148800b0068a54e524e6mr961647pfu.8.1697782189893; Thu, 19 Oct 2023 23:09:49 -0700 (PDT) Received: from free.home ([2804:7f1:2080:7ba0:18cb:7459:1c6c:8dbf]) by smtp.gmail.com with ESMTPSA id i4-20020a655b84000000b005b3a91e8a94sm584839pgr.76.2023.10.19.23.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 23:09:49 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 39K69dHa1529684 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 03:09:39 -0300 From: Alexandre Oliva To: Richard Biener Cc: gcc-patches@gcc.gnu.org, hubicka@ucw.cz Subject: [PATCH] rename make_eh_edges to make_eh_edge (was: return edge in make_eh_edges) Organization: Free thinker, does not speak for AdaCore References: Date: Fri, 20 Oct 2023 03:09:39 -0300 In-Reply-To: (Richard Biener's message of "Thu, 19 Oct 2023 11:09:19 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_QUOTING 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780253685103744297 X-GMAIL-MSGID: 1780253685103744297 On Oct 19, 2023, Richard Biener wrote: > Maybe time to do s/make_eh_edges/make_eh_edge/ though. How about this? Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu, on top of the patches for strub, hardbool, and hardcfr that I've just posted. Ok to install? ---- Since make_eh_edges creates at most one edge, rename it to make_eh_edge. for gcc/ChangeLog * tree-eh.h (make_eh_edges): Rename to... (make_eh_edge): ... this. * tree-eh.cc: Likewise. Adjust all callers. --- gcc/gimple-harden-conditionals.cc | 2 +- gcc/gimple-harden-control-flow.cc | 2 +- gcc/ipa-strub.cc | 2 +- gcc/tree-cfg.cc | 6 +++--- gcc/tree-eh.cc | 4 ++-- gcc/tree-eh.h | 2 +- gcc/tree-inline.cc | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/gimple-harden-conditionals.cc b/gcc/gimple-harden-conditionals.cc index a299b984375cd..1999e827a04ca 100644 --- a/gcc/gimple-harden-conditionals.cc +++ b/gcc/gimple-harden-conditionals.cc @@ -580,7 +580,7 @@ pass_harden_compares::execute (function *fun) if (throwing_compare_p) { add_stmt_to_eh_lp (asgnck, lookup_stmt_eh_lp (asgn)); - make_eh_edges (asgnck); + make_eh_edge (asgnck); edge ckeh; basic_block nbb = split_edge (non_eh_succ_edge diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc index 5c28fd07f3329..7b69281bffc0b 100644 --- a/gcc/gimple-harden-control-flow.cc +++ b/gcc/gimple-harden-control-flow.cc @@ -1285,7 +1285,7 @@ pass_harden_control_flow_redundancy::execute (function *fun) add_stmt_to_eh_lp (stmt, lp_eh_cleanup); /* Finally, wire the EH cleanup block into the CFG. */ - edge neeh = make_eh_edges (stmt); + edge neeh = make_eh_edge (stmt); neeh->probability = profile_probability::never (); gcc_checking_assert (neeh->dest == bb_eh_cleanup); if (neeh->dest->count.initialized_p ()) diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc index 612ece9f18552..e944fe1d1101d 100644 --- a/gcc/ipa-strub.cc +++ b/gcc/ipa-strub.cc @@ -2075,7 +2075,7 @@ gsi_insert_finally_seq_after_call (gimple_stmt_iterator gsi, gimple_seq seq) gsi_insert_before (&gsi, resx, GSI_SAME_STMT); /* Finally, wire the EH cleanup block into the CFG. */ - edge neeh = make_eh_edges (stmt); + edge neeh = make_eh_edge (stmt); neeh->probability = profile_probability::never (); gcc_checking_assert (neeh->dest == bb_eh_cleanup); gcc_checking_assert (!neeh->dest->count.initialized_p ()); diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index f748ca8508940..d41b80d93b6e7 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -878,7 +878,7 @@ make_edges_bb (basic_block bb, struct omp_region **pcur_region, int *pomp_index) fallthru = false; break; case GIMPLE_RESX: - make_eh_edges (last); + make_eh_edge (last); fallthru = false; break; case GIMPLE_EH_DISPATCH: @@ -894,7 +894,7 @@ make_edges_bb (basic_block bb, struct omp_region **pcur_region, int *pomp_index) /* If this statement has reachable exception handlers, then create abnormal edges to them. */ - make_eh_edges (last); + make_eh_edge (last); /* BUILTIN_RETURN is really a return statement. */ if (gimple_call_builtin_p (last, BUILT_IN_RETURN)) @@ -911,7 +911,7 @@ make_edges_bb (basic_block bb, struct omp_region **pcur_region, int *pomp_index) /* A GIMPLE_ASSIGN may throw internally and thus be considered control-altering. */ if (is_ctrl_altering_stmt (last)) - make_eh_edges (last); + make_eh_edge (last); fallthru = true; break; diff --git a/gcc/tree-eh.cc b/gcc/tree-eh.cc index 1cb8e08652909..6a30ed9d2b8a6 100644 --- a/gcc/tree-eh.cc +++ b/gcc/tree-eh.cc @@ -2275,7 +2275,7 @@ make_eh_dispatch_edges (geh_dispatch *stmt) if there is such a landing pad within the current function. */ edge -make_eh_edges (gimple *stmt) +make_eh_edge (gimple *stmt) { basic_block src, dst; eh_landing_pad lp; @@ -4921,7 +4921,7 @@ make_pass_cleanup_eh (gcc::context *ctxt) #endif /* Verify that BB containing STMT as the last statement, has precisely the - edge that make_eh_edges would create. */ + edge that make_eh_edge would create. */ DEBUG_FUNCTION bool verify_eh_edges (gimple *stmt) diff --git a/gcc/tree-eh.h b/gcc/tree-eh.h index 1382568b7c919..045424fe6ece3 100644 --- a/gcc/tree-eh.h +++ b/gcc/tree-eh.h @@ -30,7 +30,7 @@ extern bool remove_stmt_from_eh_lp (gimple *); extern int lookup_stmt_eh_lp_fn (struct function *, const gimple *); extern int lookup_stmt_eh_lp (const gimple *); extern bool make_eh_dispatch_edges (geh_dispatch *); -extern edge make_eh_edges (gimple *); +extern edge make_eh_edge (gimple *); extern edge redirect_eh_edge (edge, basic_block); extern void redirect_eh_dispatch_edge (geh_dispatch *, edge, basic_block); extern bool operation_could_trap_helper_p (enum tree_code, bool, bool, bool, diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index d63060c9429c4..867f3b22b589a 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.cc @@ -2615,7 +2615,7 @@ copy_edges_for_bb (basic_block bb, profile_count num, profile_count den, } else if (can_throw) { - make_eh_edges (copy_stmt); + make_eh_edge (copy_stmt); update_probs = true; }