X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-ssa-reassoc.c;h=197591e330f919f5936d0618d2a1af7458f2e56b;hb=2af78907ef2d37c7bbbf9dd45f44067d682ed9ac;hp=790635cf05bcb0ba1edc688b6ae296c546e30943;hpb=385f3f3633c41f71e014a7eaf0f2d948c86c0d83;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 790635cf05b..197591e330f 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);