Commit a864ad5b by Eric Botcazou Committed by Eric Botcazou

gimple-ssa-backprop.c (optimize_phi): Do not replace an argument corresponding to an abnormal edge.

	* gimple-ssa-backprop.c (optimize_phi): Do not replace an argument
	corresponding to an abnormal edge.

From-SVN: r233248
parent f10208b8
2016-02-09 Eric Botcazou <ebotcazou@adacore.com>
* gimple-ssa-backprop.c (optimize_phi): Do not replace an argument
corresponding to an abnormal edge.
2016-02-09 Tom de Vries <tom@codesourcery.com> 2016-02-09 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69599 PR tree-optimization/69599
......
...@@ -831,15 +831,21 @@ backprop::optimize_assign (gassign *assign, tree lhs, const usage_info *info) ...@@ -831,15 +831,21 @@ backprop::optimize_assign (gassign *assign, tree lhs, const usage_info *info)
void void
backprop::optimize_phi (gphi *phi, tree var, const usage_info *info) backprop::optimize_phi (gphi *phi, tree var, const usage_info *info)
{ {
/* If the sign of the result doesn't matter, strip sign operations /* If the sign of the result doesn't matter, try to strip sign operations
from all arguments. */ from arguments. */
if (info->flags.ignore_sign) if (info->flags.ignore_sign)
{ {
basic_block bb = gimple_bb (phi);
use_operand_p use; use_operand_p use;
ssa_op_iter oi; ssa_op_iter oi;
bool replaced = false; bool replaced = false;
FOR_EACH_PHI_ARG (use, phi, oi, SSA_OP_USE) FOR_EACH_PHI_ARG (use, phi, oi, SSA_OP_USE)
{ {
/* Propagating along abnormal edges is delicate, punt for now. */
const int index = PHI_ARG_INDEX_FROM_USE (use);
if (EDGE_PRED (bb, index)->flags & EDGE_ABNORMAL)
continue;
tree new_arg = strip_sign_op (USE_FROM_PTR (use)); tree new_arg = strip_sign_op (USE_FROM_PTR (use));
if (new_arg) if (new_arg)
{ {
......
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