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
This commit is contained in:
parent
d61c486744
commit
6b03de573e
4 changed files with 31 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
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.
|
||||
|
||||
2010-11-16 Nathan Froyd <froydnj@codesourcery.com>
|
||||
|
||||
* bitmap.c: Delete unnecessary includes.
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2010-11-16 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/44545
|
||||
* gcc.dg/pr44545.c: New testcase.
|
||||
|
||||
2010-11-16 Andrey Belevantsev <abel@ispras.ru>
|
||||
|
||||
PR rtl-optimization/46366
|
||||
|
|
13
gcc/testsuite/gcc.dg/pr44545.c
Normal file
13
gcc/testsuite/gcc.dg/pr44545.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions" } */
|
||||
int
|
||||
DrawChunk(int *tabSize, int x)
|
||||
{
|
||||
const int numEnds = 10;
|
||||
int ends[numEnds + 2];
|
||||
if (*tabSize > 0) {
|
||||
x -= 5;
|
||||
x = (x + *tabSize) / *tabSize;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue