aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ter.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
committerIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
commite252b51ccde010cbd2a146485d8045103cd99533 (patch)
treee060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/tree-ssa-ter.c
parentf10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff)
parent104c05c5284b7822d770ee51a7d91946c7e56d50 (diff)
downloadgcc-e252b51ccde010cbd2a146485d8045103cd99533.zip
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r--gcc/tree-ssa-ter.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 9eb8a11..3a057c2 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -658,11 +658,15 @@ find_replaceable_in_bb (temp_expr_table *tab, basic_block bb)
substitution list, or the def and use span a call such that
we'll expand lifetimes across a call. We also don't want to
replace across these expressions that may call libcalls that
- clobber the register involved. See PR 70184. */
+ clobber the register involved. See PR 70184. Neither
+ do we want to move possibly trapping expressions across
+ a call. See PRs 102129 and 33593. */
if (gimple_has_volatile_ops (stmt) || same_root_var
|| (tab->call_cnt[ver] != cur_call_cnt
- && SINGLE_SSA_USE_OPERAND (SSA_NAME_DEF_STMT (use), SSA_OP_USE)
- == NULL_USE_OPERAND_P)
+ && (SINGLE_SSA_USE_OPERAND (SSA_NAME_DEF_STMT (use),
+ SSA_OP_USE)
+ == NULL_USE_OPERAND_P
+ || gimple_could_trap_p (SSA_NAME_DEF_STMT (use))))
|| tab->reg_vars_cnt[ver] != cur_reg_vars_cnt)
finished_with_expr (tab, ver, true);
else