From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 1EFD8385841F; Fri, 20 Oct 2023 03:48:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EFD8385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697773702; bh=3JdidetDxMwBLeWAXT0U4ntJgVlAA7wzImuM/9yK02Y=; h=From:To:Subject:Date:From; b=YI5qL/+adar7Eb9BuuVX6dDAfAKfnKe62tzVOyRqCYk4ntE5JuEhTSUNCY0O3duJe IzSMRM6OnqGk9Wpq2PssGPKcP3/EZvk5e5pawRIFiItMfm2DX9EJkZ4IG/bY4/SNom HCixAvSY2giSNYv7NsXfrYrDG5HyKg2jlrYYTwtw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] set hardcfr eh probs X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 9231203d6d72f1a9e10e564fc4ebd6e7abb74c9f X-Git-Newrev: 3537621375e746a5eb46847bd832362ec484cfe2 Message-Id: <20231020034822.1EFD8385841F@sourceware.org> Date: Fri, 20 Oct 2023 03:48:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3537621375e746a5eb46847bd832362ec484cfe2 commit 3537621375e746a5eb46847bd832362ec484cfe2 Author: Alexandre Oliva Date: Thu Oct 19 02:53:10 2023 -0300 set hardcfr eh probs Diff: --- gcc/gimple-harden-control-flow.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc index 546837a450b8..05878c978433 100644 --- a/gcc/gimple-harden-control-flow.cc +++ b/gcc/gimple-harden-control-flow.cc @@ -913,6 +913,9 @@ public: = profile_probability::always (); edge e = make_edge (gsi_bb (gsi), trp, EDGE_TRUE_VALUE); e->probability = profile_probability::never (); + gcc_checking_assert (e->dest == trp); + gcc_checking_assert (!e->dest->count.initialized_p ()); + e->dest->count = e->count (); /* Set the trap's dominator after splitting. */ if (dom_info_available_p (CDI_DOMINATORS)) @@ -1276,7 +1279,13 @@ 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. */ - make_eh_edges (stmt); + edge neeh = make_eh_edges (stmt); + neeh->probability = profile_probability::never (); + gcc_checking_assert (neeh->dest == bb_eh_cleanup); + if (neeh->dest->count.initialized_p ()) + neeh->dest->count += neeh->count (); + else + neeh->dest->count = neeh->count (); } }