From: Kugan Vivekanandarajah Date: Tue, 24 May 2016 22:29:27 +0000 (+0000) Subject: tree-ssa-reassoc.c (sort_by_operand_rank): Skip checking gimple_bb when there is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2bc145afaa6db175fa6d6e7556432ad27f13289b;p=gcc.git tree-ssa-reassoc.c (sort_by_operand_rank): Skip checking gimple_bb when there is stmt_to_insert. gcc/ChangeLog: 2016-05-24 Kugan Vivekanandarajah * tree-ssa-reassoc.c (sort_by_operand_rank): Skip checking gimple_bb when there is stmt_to_insert. gcc/testsuite/ChangeLog: 2016-05-24 Kugan Vivekanandarajah * gcc.dg/tree-ssa/reassoc-44.c: New test. From-SVN: r236673 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b07aa808891..238cd07178d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-24 Kugan Vivekanandarajah + + * tree-ssa-reassoc.c (sort_by_operand_rank): Skip checking gimple_bb + when there is stmt_to_insert. + 2016-05-24 Martin Sebor PR c++/71147 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a2821a7c9c7..d81eedda023 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-24 Kugan Vivekanandarajah + + * gcc.dg/tree-ssa/reassoc-44.c: New test. + 2016-05-24 Pat Haugen PR target/71050 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-44.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-44.c new file mode 100644 index 00000000000..1d946f6b604 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-44.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +unsigned int a; +int b, c; +void fn1 () +{ + b = a + c + c; +} diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 3b0266767a3..c9ed6795679 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -519,6 +519,8 @@ sort_by_operand_rank (const void *pa, const void *pb) See PR60418. */ if (!SSA_NAME_IS_DEFAULT_DEF (oea->op) && !SSA_NAME_IS_DEFAULT_DEF (oeb->op) + && !oea->stmt_to_insert + && !oeb->stmt_to_insert && SSA_NAME_VERSION (oeb->op) != SSA_NAME_VERSION (oea->op)) { gimple *stmta = SSA_NAME_DEF_STMT (oea->op);