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  <kuganv@linaro.org>

	* 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  <kuganv@linaro.org>

	* gcc.dg/tree-ssa/reassoc-44.c: New test.

From-SVN: r236673
This commit is contained in:
Kugan Vivekanandarajah 2016-05-24 22:29:27 +00:00 committed by Kugan Vivekanandarajah
parent 26869fdb47
commit 2bc145afaa
4 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2016-05-24 Kugan Vivekanandarajah <kuganv@linaro.org>
* tree-ssa-reassoc.c (sort_by_operand_rank): Skip checking gimple_bb
when there is stmt_to_insert.
2016-05-24 Martin Sebor <msebor@redhat.com>
PR c++/71147

View file

@ -1,3 +1,7 @@
2016-05-24 Kugan Vivekanandarajah <kuganv@linaro.org>
* gcc.dg/tree-ssa/reassoc-44.c: New test.
2016-05-24 Pat Haugen <pthaugen@us.ibm.com>
PR target/71050

View file

@ -0,0 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
unsigned int a;
int b, c;
void fn1 ()
{
b = a + c + c;
}

View file

@ -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);