Commit 777a4e9a by Bill Schmidt Committed by William Schmidt

re PR tree-optimization/49749 (Reassociation rank algorithm does not include all non-NULL operands)

2011-07-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/49749
	* tree-ssa-reassoc.c (get_rank): Fix operand scan conditions and
	remove no-longer-used maxrank variable.

From-SVN: r176581
parent d4add952
2011-07-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/49749
* tree-ssa-reassoc.c (get_rank): Fix operand scan conditions and
remove no-longer-used maxrank variable.
2011-07-21 Georg-Johann Lay <avr@gjlay.de> 2011-07-21 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs. * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
......
...@@ -235,7 +235,7 @@ get_rank (tree e) ...@@ -235,7 +235,7 @@ get_rank (tree e)
if (TREE_CODE (e) == SSA_NAME) if (TREE_CODE (e) == SSA_NAME)
{ {
gimple stmt; gimple stmt;
long rank, maxrank; long rank;
int i, n; int i, n;
if (TREE_CODE (SSA_NAME_VAR (e)) == PARM_DECL if (TREE_CODE (SSA_NAME_VAR (e)) == PARM_DECL
...@@ -258,7 +258,6 @@ get_rank (tree e) ...@@ -258,7 +258,6 @@ get_rank (tree e)
/* Otherwise, find the maximum rank for the operands, or the bb /* Otherwise, find the maximum rank for the operands, or the bb
rank, whichever is less. */ rank, whichever is less. */
rank = 0; rank = 0;
maxrank = bb_rank[gimple_bb(stmt)->index];
if (gimple_assign_single_p (stmt)) if (gimple_assign_single_p (stmt))
{ {
tree rhs = gimple_assign_rhs1 (stmt); tree rhs = gimple_assign_rhs1 (stmt);
...@@ -267,15 +266,15 @@ get_rank (tree e) ...@@ -267,15 +266,15 @@ get_rank (tree e)
rank = MAX (rank, get_rank (rhs)); rank = MAX (rank, get_rank (rhs));
else else
{ {
for (i = 0; for (i = 0; i < n; i++)
i < n && TREE_OPERAND (rhs, i) && rank != maxrank; i++) if (TREE_OPERAND (rhs, i))
rank = MAX(rank, get_rank (TREE_OPERAND (rhs, i))); rank = MAX(rank, get_rank (TREE_OPERAND (rhs, i)));
} }
} }
else else
{ {
n = gimple_num_ops (stmt); n = gimple_num_ops (stmt);
for (i = 1; i < n && rank != maxrank; i++) for (i = 1; i < n; i++)
{ {
gcc_assert (gimple_op (stmt, i)); gcc_assert (gimple_op (stmt, i));
rank = MAX(rank, get_rank (gimple_op (stmt, i))); rank = MAX(rank, get_rank (gimple_op (stmt, i)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment