diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2016-02-09 17:21:57 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2016-02-09 17:21:57 +0000 |
commit | a15c9ea0031aaf26b4c9206994c76306795464e5 (patch) | |
tree | 3d14d10508e1d4a7e5509b5718d3106975df3043 | |
parent | 8cd51bbe07079f2ac937a774b0fd2834dd40ef01 (diff) |
* gimple-ssa-backprop.c (optimize_phi): Do not replace an argument
corresponding to an abnormal edge.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@233248 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimple-ssa-backprop.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c4ee0a04f9d..9149642baa6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> PR tree-optimization/69599 diff --git a/gcc/gimple-ssa-backprop.c b/gcc/gimple-ssa-backprop.c index 3e64a7010c6..d96bccac555 100644 --- a/gcc/gimple-ssa-backprop.c +++ b/gcc/gimple-ssa-backprop.c @@ -831,15 +831,21 @@ backprop::optimize_assign (gassign *assign, tree lhs, const usage_info *info) void backprop::optimize_phi (gphi *phi, tree var, const usage_info *info) { - /* If the sign of the result doesn't matter, strip sign operations - from all arguments. */ + /* If the sign of the result doesn't matter, try to strip sign operations + from arguments. */ if (info->flags.ignore_sign) { + basic_block bb = gimple_bb (phi); use_operand_p use; ssa_op_iter oi; bool replaced = false; 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)); if (new_arg) { |