re PR tree-optimization/17742 (C Optimization error with -O1 on i686)

PR tree-optimization/17742
	* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle
	MINUS_EXPR correctly.

From-SVN: r90492
This commit is contained in:
Zdenek Dvorak 2004-11-11 21:12:34 +01:00 committed by Zdenek Dvorak
parent e0afb98af7
commit f8e9d51205
2 changed files with 11 additions and 55 deletions

View File

@ -1,3 +1,9 @@
2004-11-11 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/17742
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle
MINUS_EXPR correctly.
2004-11-11 Sebastian Pop <pop@cri.ensmp.fr>
* tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi):

View File

@ -1185,66 +1185,16 @@ follow_ssa_edge_in_rhs (struct loop *loop,
STRIP_TYPE_NOPS (rhs1);
if (TREE_CODE (rhs0) == SSA_NAME)
{
if (TREE_CODE (rhs1) == SSA_NAME)
{
/* Match an assignment under the form:
"a = b - c". */
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
evolution_of_loop);
if (res)
*evolution_of_loop = add_to_evolution
(loop->num, chrec_convert (type_rhs, *evolution_of_loop),
MINUS_EXPR, rhs1);
else
{
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs1), halting_phi,
evolution_of_loop);
if (res)
*evolution_of_loop = add_to_evolution
(loop->num,
chrec_fold_multiply (type_rhs,
*evolution_of_loop,
build_int_cst_type (type_rhs, -1)),
PLUS_EXPR, rhs0);
}
}
else
{
/* Match an assignment under the form:
"a = b - ...". */
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
evolution_of_loop);
if (res)
*evolution_of_loop = add_to_evolution
(loop->num, chrec_convert (type_rhs, *evolution_of_loop),
MINUS_EXPR, rhs1);
}
}
else if (TREE_CODE (rhs1) == SSA_NAME)
{
/* Match an assignment under the form:
"a = ... - c". */
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs1), halting_phi,
evolution_of_loop);
"a = b - ...". */
res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
evolution_of_loop);
if (res)
*evolution_of_loop = add_to_evolution
(loop->num,
chrec_fold_multiply (type_rhs,
*evolution_of_loop,
build_int_cst_type (type_rhs, -1)),
PLUS_EXPR, rhs0);
(loop->num, chrec_convert (type_rhs, *evolution_of_loop),
MINUS_EXPR, rhs1);
}
else
/* Otherwise, match an assignment under the form:
"a = ... - ...". */