From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id 358E33858D1E for ; Thu, 19 Oct 2023 09:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 358E33858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 358E33858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::129 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697706743; cv=none; b=nDXYCH/V/y5Rq2mrv7RJOU17qb/KlwHkj31xEBDKr+7+H8/Hulcmf8kuTAPilVj7J4qMHx8hcsk7ZGEu0EMrpW9hWAU2aD3BCAFS3TRvgp5x7gUFWxaolcjXkwt/eqy8l7zcz/rDJFTRredhQ+JHBEaDCZqqve/AxbHiHwq4ucI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697706743; c=relaxed/simple; bh=Cb6DGILbVu2rRqkLMqmCn5nlpFQBFJ5ud/sa2TxMqQI=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Q3OvJPN+tXEULA/4QwQ8CoeXiaGsJzmYMXvYTn1uGDicjAF1/XNf2b8nrVIFP3/x90sYVqcJE+xzspFmLR2rw02mupyCHCC0xNq3nmRYkjOEcaDuVxARqZmQtGFi5qzpApy0xA+0/f2sJqJEE8w56TwRnWXKQLaGfnzZeoggm1A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507ac66a969so5626779e87.3 for ; Thu, 19 Oct 2023 02:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697706739; x=1698311539; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xkamqRzdbXjN3RMrvXXmCgKJAEFuHCX35qrf99GoJdQ=; b=QQQDU9DmAWWSnYSe+p1pJgldVqQlq8sUpX4+HWKage8tgP9dF/SZr3dhcz6Wl/QI1Y q83pgwF7Wh6vJukZV8R17h7sSRj+J113xv/IQG6PHpszHDyHFyCSUULc0Bt5IPusXKPh YFvc3ysTcMWUtKG5UMcKz7mAdOUhTIXs1BRyiVKA0XfIdX++n1vTXYNirWCBubd6YJo/ B/PrYnpU4DADMI1bEeog8uzbBdEwPKmRjXGRlVBkrKU4JFcSDLDDAQhPQoW2UW1IAjWE 4VUmcC5scaVfvAoSeFRrPWUiSgzMqglFjyKIyh2zNZsJWXzHIhDwjeViPkDvUjvlw5ai BGBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697706739; x=1698311539; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xkamqRzdbXjN3RMrvXXmCgKJAEFuHCX35qrf99GoJdQ=; b=rc00xIh5GLXZFTBfadzPHXYu0NYqzTvt/Jl7P7D2kVE/AofzwZBpFKTFnlz4uT+IEC 8FH8jpK+fG1YB5DW3EBCayWnjkijdOqNGr9/WX4175IwjaQoj7Cp+yMPnNJ9qB4WxVus AlYe8wq4P6/AraP1x5zDnupc1WuLynRwb9sST4299A6Yy2gInF4gb3uU5XDtELq5PQyu nPGHl0QHe1Qo/H2E5JwC0QJ+3gebIZJOqjbmgQr+yC+NB3PJG3ihN373aoGFo9sRjlwK whz33thfJozRYlxVg0NwpwxTpcnIKOKU/DmY6O5A+uclrIoy7dWHdNYKjs6pROdbalox i08A== X-Gm-Message-State: AOJu0Ywr/tvl40LTGXW7DIoYoGAcXMiFycLHHUdjwIy5op2rs5FZNOwQ oo0GPVgiLGFORTuhhtYd77hn9t47qY0QjpwCg6A= X-Google-Smtp-Source: AGHT+IGm0jrh2cFr+gPY1zYZLZ7alamZy2aJrQ8V2UAtlO9juwx2EgK3D0U3LYY5Yaagum6nNo1HJIUG1qZpDmzzoYQ= X-Received: by 2002:ac2:4827:0:b0:500:adbd:43e7 with SMTP id 7-20020ac24827000000b00500adbd43e7mr930868lft.8.1697706739219; Thu, 19 Oct 2023 02:12:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Thu, 19 Oct 2023 11:09:19 +0200 Message-ID: Subject: Re: [PATCH] return edge in make_eh_edges To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, hubicka@ucw.cz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: On Thu, Oct 19, 2023 at 9:59=E2=80=AFAM Alexandre Oliva = wrote: > > > 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. > > Regstrapped on x86_64-linux-gnu, and (along with various hardening > patches) on ppc64el-linux-gnu. Also tested on multiple other targets, > on older versions of GCC. The returned value is unused in code already > in the compiler. This is a preparatory patch for uses to be introduced > along with stack scrubbing and control flow redundancy. Ok to install? OK. Maybe time to do s/make_eh_edges/make_eh_edge/ though. Richard. > > for gcc/ChangeLog > > * tree-eh.cc (make_eh_edges): Return the new edge. > * tree-eh.h (make_eh_edges): Likewise. > --- > 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 e8ceff36cc6e7..1cb8e08652909 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 =3D lookup_stmt_eh_lp (stmt); > if (lp_nr <=3D 0) > - return; > + return NULL; > > lp =3D get_eh_landing_pad_from_number (lp_nr); > gcc_assert (lp !=3D NULL); > > src =3D gimple_bb (stmt); > dst =3D 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 tre= e; > diff --git a/gcc/tree-eh.h b/gcc/tree-eh.h > index 771be50fe9a1d..1382568b7c919 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, b= ool, > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity > Excluding neuro-others for not behaving ""normal"" is *not* inclusive