* [PATCH] middle-end/106909 - CTRL altering flag after folding
@ 2022-09-13 8:52 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-09-13 8:52 UTC (permalink / raw)
To: gcc-patches
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
PR middle-end/106909
* gimple-fold.cc (gimple_fold_call): Clear the ctrl-altering
flag of a unreachable call.
---
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)
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-13 8:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 8:52 [PATCH] middle-end/106909 - CTRL altering flag after folding Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).