/* Return true if we may propagate ORIG into DEST, false otherwise.
- If DEST_NOT_PHI_ARG_P is true then assume the propagation does
- not happen into a PHI argument which relaxes some constraints. */
+ If DEST_NOT_ABNORMAL_PHI_EDGE_P is true then assume the propagation does
+ not happen into a PHI argument which flows in from an abnormal edge
+ which relaxes some constraints. */
bool
-may_propagate_copy (tree dest, tree orig, bool dest_not_phi_arg_p)
+may_propagate_copy (tree dest, tree orig, bool dest_not_abnormal_phi_edge_p)
{
tree type_d = TREE_TYPE (dest);
tree type_o = TREE_TYPE (orig);
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig))
return false;
/* Similarly if DEST flows in from an abnormal edge then the copy cannot be
- propagated. If we know we do not propagate into a PHI argument this
+ propagated. If we know we do not propagate into such a PHI argument this
does not apply. */
- else if (!dest_not_phi_arg_p
+ else if (!dest_not_abnormal_phi_edge_p
&& TREE_CODE (dest) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest))
return false;
propagate_value (use_operand_p op_p, tree val)
{
if (flag_checking)
- gcc_assert (may_propagate_copy (USE_FROM_PTR (op_p), val,
- !is_a <gphi *> (USE_STMT (op_p))));
+ {
+ bool ab = (is_a <gphi *> (USE_STMT (op_p))
+ && (gimple_phi_arg_edge (as_a <gphi *> (USE_STMT (op_p)),
+ PHI_ARG_INDEX_FROM_USE (op_p))
+ ->flags & EDGE_ABNORMAL));
+ gcc_assert (may_propagate_copy (USE_FROM_PTR (op_p), val, !ab));
+ }
replace_exp (op_p, val);
}
|| virtual_operand_p (arg))
continue;
tree sprime = eliminate_avail (b, arg);
- if (sprime && may_propagate_copy (arg, sprime))
+ if (sprime && may_propagate_copy (arg, sprime,
+ !(e->flags & EDGE_ABNORMAL)))
propagate_value (use_p, sprime);
}
arg);
if (sprime
&& sprime != arg
- && may_propagate_copy (arg, sprime))
+ && may_propagate_copy (arg, sprime, !(e->flags & EDGE_ABNORMAL)))
propagate_value (use_p, sprime);
}