From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 83166385116F; Tue, 13 Sep 2022 08:52:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83166385116F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663059162; bh=SF3hi1N+b7YTIAPAg/lZ/++n4dgUoQqowRQ4OoSAGkw=; h=From:To:Subject:Date:From; b=Z5wpmkgRFAv8xzusN6CdpxB7vhht/UD0QXTGGwacJZkRbFJZdlbx6rP1fqLdmgpZA Qdz3IJIrVNmFiO7i82iooeXslv9pyANldnTLka6iA3Zt2bu5m1/SZJpc9S4cbC/8x0 8cELSD1efAIYtpBm4NYXbp/FVM7Tf2GYz9fwVj+k= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2640] middle-end/106909 - CTRL altering flag after folding X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: ad08894ea02b6308c4ed4e8cd8e6a564c2f581e8 X-Git-Newrev: 2c867232df70d3de304714906b4198ecb262eb32 Message-Id: <20220913085242.83166385116F@sourceware.org> Date: Tue, 13 Sep 2022 08:52:42 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2c867232df70d3de304714906b4198ecb262eb32 commit r13-2640-g2c867232df70d3de304714906b4198ecb262eb32 Author: Richard Biener Date: Tue Sep 13 08:59:41 2022 +0200 middle-end/106909 - CTRL altering flag after folding The following makes sure to clear the CTRL altering flag when folding emits a __builitin_unreachable in place of a virtual call which now might become a trap. PR middle-end/106909 * gimple-fold.cc (gimple_fold_call): Clear the ctrl-altering flag of a unreachable call. Diff: --- gcc/gimple-fold.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index a1704784bc9..9055cd8982d 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -5512,6 +5512,7 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) { location_t loc = gimple_location (stmt); gimple *new_stmt = gimple_build_builtin_unreachable (loc); + gimple_call_set_ctrl_altering (new_stmt, false); /* If the call had a SSA name as lhs morph that into an uninitialized value. */ if (lhs && TREE_CODE (lhs) == SSA_NAME)