From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id D0C4B3858C52; Fri, 20 Oct 2023 03:37:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0C4B3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697773050; bh=eOKeWgy6N9lI4tcejjVtrt5/IjJYSaHhIjQDLfw0aBA=; h=From:To:Subject:Date:From; b=CBX8VXcJZHcBb4eIPyF078YBg+yNkcAj4MMYnTNvOypWH5IdPLRhvkYWMVTj2O6F0 7UgDToUkCRL3CgW3tdk8WgOzhVwFXCatS1ztNlrlwzfCnh9wYmtToaCKHogCWB9T3t Fk4DecJW35gCIvulTjUFks3+nd1GRjsal21L8dD8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4772] return edge in make_eh_edges X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/heads/master X-Git-Oldrev: 1d260ab0e39ea63644e3af3ab2e0db946026b5a6 X-Git-Newrev: df252e0f254638c44034f1879db34286c88a92c2 Message-Id: <20231020033730.D0C4B3858C52@sourceware.org> Date: Fri, 20 Oct 2023 03:37:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:df252e0f254638c44034f1879db34286c88a92c2 commit r14-4772-gdf252e0f254638c44034f1879db34286c88a92c2 Author: Alexandre Oliva Date: Fri Oct 20 00:35:17 2023 -0300 return edge in make_eh_edges The need to initialize edge probabilities has made make_eh_edges undesirably hard to use. I suppose we don't want make_eh_edges to initialize the probability of the newly-added edge itself, so that the caller takes care of it, but identifying the added edge in need of adjustments is inefficient and cumbersome. Change make_eh_edges so that it returns the added edge. for gcc/ChangeLog * tree-eh.cc (make_eh_edges): Return the new edge. * tree-eh.h (make_eh_edges): Likewise. Diff: --- gcc/tree-eh.cc | 6 +++--- gcc/tree-eh.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/tree-eh.cc b/gcc/tree-eh.cc index e8ceff36cc6e..1cb8e0865290 100644 --- a/gcc/tree-eh.cc +++ b/gcc/tree-eh.cc @@ -2274,7 +2274,7 @@ make_eh_dispatch_edges (geh_dispatch *stmt) /* Create the single EH edge from STMT to its nearest landing pad, if there is such a landing pad within the current function. */ -void +edge make_eh_edges (gimple *stmt) { basic_block src, dst; @@ -2283,14 +2283,14 @@ make_eh_edges (gimple *stmt) lp_nr = lookup_stmt_eh_lp (stmt); if (lp_nr <= 0) - return; + return NULL; lp = get_eh_landing_pad_from_number (lp_nr); gcc_assert (lp != NULL); src = gimple_bb (stmt); dst = label_to_block (cfun, lp->post_landing_pad); - make_edge (src, dst, EDGE_EH); + return make_edge (src, dst, EDGE_EH); } /* Do the work in redirecting EDGE_IN to NEW_BB within the EH region tree; diff --git a/gcc/tree-eh.h b/gcc/tree-eh.h index 771be50fe9a1..1382568b7c91 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 void make_eh_edges (gimple *); +extern edge make_eh_edges (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,