diff options
author | Richard Guenther <rguenther@suse.de> | 2010-11-16 14:15:55 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-11-16 14:15:55 +0000 |
commit | 6b03de573e88f7cb8a50bbcde75427153084fe63 (patch) | |
tree | 78458f4d7ffc2e353bb0f301c6616d2c851ba959 /gcc/tree-ssa-reassoc.c | |
parent | d61c486744841d15dd9131cbcbc7bd5c27a06eaa (diff) | |
download | gcc-6b03de573e88f7cb8a50bbcde75427153084fe63.zip gcc-6b03de573e88f7cb8a50bbcde75427153084fe63.tar.gz gcc-6b03de573e88f7cb8a50bbcde75427153084fe63.tar.bz2 |
re PR tree-optimization/44545 (internal compiler error: in remove_unreachable_handlers, at tree-eh)
2010-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44545
* tree-ssa-reassoc.c (linearize_expr_tree): Possibly throwing
statements are not reassociatable.
(reassociate_bb): Likewise.
* gcc.dg/pr44545.c: New testcase.
From-SVN: r166799
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 790635c..197591e 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1786,13 +1786,15 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt, if (TREE_CODE (binlhs) == SSA_NAME) { binlhsdef = SSA_NAME_DEF_STMT (binlhs); - binlhsisreassoc = is_reassociable_op (binlhsdef, rhscode, loop); + binlhsisreassoc = (is_reassociable_op (binlhsdef, rhscode, loop) + && !stmt_could_throw_p (binlhsdef)); } if (TREE_CODE (binrhs) == SSA_NAME) { binrhsdef = SSA_NAME_DEF_STMT (binrhs); - binrhsisreassoc = is_reassociable_op (binrhsdef, rhscode, loop); + binrhsisreassoc = (is_reassociable_op (binrhsdef, rhscode, loop) + && !stmt_could_throw_p (binrhsdef)); } /* If the LHS is not reassociable, but the RHS is, we need to swap @@ -2027,7 +2029,8 @@ reassociate_bb (basic_block bb) { gimple stmt = gsi_stmt (gsi); - if (is_gimple_assign (stmt)) + if (is_gimple_assign (stmt) + && !stmt_could_throw_p (stmt)) { tree lhs, rhs1, rhs2; enum tree_code rhs_code = gimple_assign_rhs_code (stmt); |