diff options
author | Kugan Vivekanandarajah <kuganv@linaro.org> | 2016-05-24 10:50:01 +0000 |
---|---|---|
committer | Kugan Vivekanandarajah <kugan@gcc.gnu.org> | 2016-05-24 10:50:01 +0000 |
commit | ca6f60bc49de2ff3d150b6393148bdc468967eec (patch) | |
tree | 8f03741c51214f749dc37af85ff654e56232dd5a /gcc/tree-ssa-reassoc.c | |
parent | d3465d72bacd65663da8f8b4977f2936a799c3cd (diff) | |
download | gcc-ca6f60bc49de2ff3d150b6393148bdc468967eec.zip gcc-ca6f60bc49de2ff3d150b6393148bdc468967eec.tar.gz gcc-ca6f60bc49de2ff3d150b6393148bdc468967eec.tar.bz2 |
re PR tree-optimization/71252 (ICE: verify_ssa failed : definition in block 7 does not dominate use in block 6)
gcc/testsuite/ChangeLog:
2016-05-24 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/71252
* gfortran.dg/pr71252.f90: New test.
gcc/ChangeLog:
2016-05-24 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/71252
* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Add stmt_to_insert after
build_and_add_sum creates new use stmt.
From-SVN: r236634
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index fb683ad..28823a2 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -4091,24 +4091,30 @@ rewrite_expr_tree_parallel (gassign *stmt, int width, print_gimple_stmt (dump_file, stmts[i], 0, 0); } - /* If the stmt that defines operand has to be inserted, insert it - before the use. */ - if (stmt1) - insert_stmt_before_use (stmts[i], stmt1); - if (stmt2) - insert_stmt_before_use (stmts[i], stmt2); - /* We keep original statement only for the last one. All others are recreated. */ if (i == stmt_num - 1) { + /* If the stmt that defines operand has to be inserted, insert it + before the use. */ + if (stmt1) + insert_stmt_before_use (stmts[i], stmt1); + if (stmt2) + insert_stmt_before_use (stmts[i], stmt2); gimple_assign_set_rhs1 (stmts[i], op1); gimple_assign_set_rhs2 (stmts[i], op2); update_stmt (stmts[i]); } else - stmts[i] = build_and_add_sum (TREE_TYPE (last_rhs1), op1, op2, opcode); - + { + stmts[i] = build_and_add_sum (TREE_TYPE (last_rhs1), op1, op2, opcode); + /* If the stmt that defines operand has to be inserted, insert it + before new build_and_add stmt after it is created. */ + if (stmt1) + insert_stmt_before_use (stmts[i], stmt1); + if (stmt2) + insert_stmt_before_use (stmts[i], stmt2); + } if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, " into "); |