summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ter.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-30 16:00:36 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-30 16:00:36 +0000
commit52dfd149bd1a8babe28c3a8a22d7f7db321276ad (patch)
tree258ac9ccc0b2befc416c750a3f7f91966492098c /gcc/tree-ssa-ter.c
parent16fbdf4ac9baa7cea0238dd86fc506e11934e9f3 (diff)
downloadgcc-52dfd149bd1a8babe28c3a8a22d7f7db321276ad.tar.gz
PR 33593
* tree-ssa-ter.c (is_replaceable_p): Return false if STMT may throw an exception. testsuite/ChangeLog PR 33593 * g++.dg/tree-ssa/pr33593.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128893 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r--gcc/tree-ssa-ter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 824252e8b9f..f0fef24aa4a 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -366,6 +366,10 @@ is_replaceable_p (tree stmt)
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
+ /* If the statement may throw an exception, it cannot be replaced. */
+ if (tree_could_throw_p (stmt))
+ return false;
+
/* Punt if there is more than 1 def. */
def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
if (!def)