From: Kugan Vivekanandarajah Date: Mon, 30 May 2016 10:45:19 +0000 (+0000) Subject: re PR tree-optimization/71252 (ICE: verify_ssa failed : definition in block 7 does... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db5447cad85ddee2973bc95cb5d4890b8c3d847b;p=gcc.git re PR tree-optimization/71252 (ICE: verify_ssa failed : definition in block 7 does not dominate use in block 6) gcc/ChangeLog: 2016-05-30 Kugan Vivekanandarajah PR middle-end/71252 * tree-ssa-reassoc.c (swap_ops_for_binary_stmt): Fix swap such that all fields including stmt_to_insert are swapped. gcc/testsuite/ChangeLog: 2016-05-30 Kugan Vivekanandarajah PR middle-end/71252 * gcc.dg/tree-ssa/pr71252-2.c: New test. From-SVN: r236875 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 815a43da5ec..c88748f8840 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-30 Kugan Vivekanandarajah + + PR middle-end/71252 + * tree-ssa-reassoc.c (swap_ops_for_binary_stmt): Fix swap such that + all fields including stmt_to_insert are swapped. + 2016-05-30 Jan Hubicka * predict.h (force_edge_cold): Declare. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b989b4e5d6..37f06b78c99 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-30 Kugan Vivekanandarajah + + PR middle-end/71252 + * gcc.dg/tree-ssa/pr71252-2.c: New test. + 2016-05-30 Jan Hubicka * gcc.dg/tree-ssa/cunroll-12.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr71252-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr71252-2.c new file mode 100644 index 00000000000..e621d3eb469 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr71252-2.c @@ -0,0 +1,9 @@ +/* PR middle-end/71252 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +unsigned a; +int b, c; +void fn1 () +{ + b = a + c + 3 + c; +} diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index c9ed6795679..d13be29ffc7 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -3763,25 +3763,13 @@ swap_ops_for_binary_stmt (vec ops, || (stmt && is_phi_for_stmt (stmt, oe3->op) && !is_phi_for_stmt (stmt, oe1->op) && !is_phi_for_stmt (stmt, oe2->op))) - { - operand_entry temp = *oe3; - oe3->op = oe1->op; - oe3->rank = oe1->rank; - oe1->op = temp.op; - oe1->rank= temp.rank; - } + std::swap (*oe1, *oe3); else if ((oe1->rank == oe3->rank && oe2->rank != oe3->rank) || (stmt && is_phi_for_stmt (stmt, oe2->op) && !is_phi_for_stmt (stmt, oe1->op) && !is_phi_for_stmt (stmt, oe3->op))) - { - operand_entry temp = *oe2; - oe2->op = oe1->op; - oe2->rank = oe1->rank; - oe1->op = temp.op; - oe1->rank = temp.rank; - } + std::swap (*oe1, *oe3); } /* If definition of RHS1 or RHS2 dominates STMT, return the later of those