aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-09-13 08:59:41 +0200
committerRichard Biener <rguenther@suse.de>2022-09-13 10:52:17 +0200
commit2c867232df70d3de304714906b4198ecb262eb32 (patch)
tree98efebf07b1afc6bacc0470b1111578df9ae3ea9 /gcc
parentad08894ea02b6308c4ed4e8cd8e6a564c2f581e8 (diff)
downloadgcc-2c867232df70d3de304714906b4198ecb262eb32.zip
gcc-2c867232df70d3de304714906b4198ecb262eb32.tar.gz
gcc-2c867232df70d3de304714906b4198ecb262eb32.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-fold.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index a170478..9055cd8 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)