aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-23 12:08:41 +0000
committerRichard Guenther <rguenther@suse.de>2011-05-23 12:08:41 +0000
commit37fb0533af1a8cc33d4f383783f798f513ee75f3 (patch)
tree517ad43ddd93528a11fead28a4b00d0da1d17b8b /gcc/tree-ssa-alias.c
parentdec1a120ffb8ccb7023dbc35ce8e6dc7c2dc5510 (diff)
2011-05-23 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49115 * tree-ssa-alias.c (stmt_kills_ref_p_1): If the assignment is not necessarily carried out, do not claim it kills the ref. * tree-ssa-dce.c (mark_aliased_reaching_defs_necessary_1): Likewise. * g++.dg/torture/pr49115.C: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@174066 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 315a252fadc..ba76ae10ab1 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1633,7 +1633,14 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref *ref)
return false;
if (gimple_has_lhs (stmt)
- && TREE_CODE (gimple_get_lhs (stmt)) != SSA_NAME)
+ && TREE_CODE (gimple_get_lhs (stmt)) != SSA_NAME
+ /* The assignment is not necessarily carried out if it can throw
+ and we can catch it in the current function where we could inspect
+ the previous value.
+ ??? We only need to care about the RHS throwing. For aggregate
+ assignments or similar calls and non-call exceptions the LHS
+ might throw as well. */
+ && !stmt_can_throw_internal (stmt))
{
tree base, lhs = gimple_get_lhs (stmt);
HOST_WIDE_INT size, offset, max_size;