aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r--gcc/tree-ssa-propagate.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 9f4d381..0195afa 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -1275,21 +1275,24 @@ may_propagate_copy (tree dest, tree orig)
tree type_d = TREE_TYPE (dest);
tree type_o = TREE_TYPE (orig);
- /* If ORIG flows in from an abnormal edge, it cannot be propagated. */
+ /* If ORIG is a default definition which flows in from an abnormal edge
+ then the copy can be propagated. It is important that we do so to avoid
+ uninitialized copies. */
if (TREE_CODE (orig) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig)
- /* If it is the default definition and an automatic variable then
- we can though and it is important that we do to avoid
- uninitialized regular copies. */
- && !(SSA_NAME_IS_DEFAULT_DEF (orig)
- && (SSA_NAME_VAR (orig) == NULL_TREE
- || TREE_CODE (SSA_NAME_VAR (orig)) == VAR_DECL)))
+ && SSA_NAME_IS_DEFAULT_DEF (orig)
+ && (SSA_NAME_VAR (orig) == NULL_TREE
+ || TREE_CODE (SSA_NAME_VAR (orig)) == VAR_DECL))
+ ;
+ /* Otherwise if ORIG just flows in from an abnormal edge then the copy cannot
+ be propagated. */
+ else if (TREE_CODE (orig) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig))
return false;
-
- /* If DEST is an SSA_NAME that flows from an abnormal edge, then it
- cannot be replaced. */
- if (TREE_CODE (dest) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest))
+ /* Similarly if DEST flows in from an abnormal edge then the copy cannot be
+ propagated. */
+ else if (TREE_CODE (dest) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest))
return false;
/* Do not copy between types for which we *do* need a conversion. */