diff options
author | Richard Biener <rguenther@suse.de> | 2013-08-29 11:20:16 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-08-29 11:20:16 +0000 |
commit | 1b27500048b97fbdf53c5407e2dbc8f91c439481 (patch) | |
tree | 2b171d0dc3143399511b4fee994d22982c91662c /gcc/tree-ssa-copy.c | |
parent | 6b1184bab6d4f38dbab3a970634510bf9fc675b2 (diff) | |
download | gcc-1b27500048b97fbdf53c5407e2dbc8f91c439481.zip gcc-1b27500048b97fbdf53c5407e2dbc8f91c439481.tar.gz gcc-1b27500048b97fbdf53c5407e2dbc8f91c439481.tar.bz2 |
re PR middle-end/57287 (Bogus uninitialized warning with abnormal control flow)
2013-08-29 Richard Biener <rguenther@suse.de>
PR middle-end/57287
* tree-ssa-copy.c (may_propagate_copy): Allow propagating
of default defs that appear in abnormal PHI nodes.
* gcc.dg/pr57287-2.c: New testcase.
From-SVN: r202069
Diffstat (limited to 'gcc/tree-ssa-copy.c')
-rw-r--r-- | gcc/tree-ssa-copy.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index 75ab54a..9bc455c 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -60,7 +60,13 @@ may_propagate_copy (tree dest, tree orig) /* If ORIG flows in from an abnormal edge, it cannot be propagated. */ if (TREE_CODE (orig) == SSA_NAME - && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig)) + && 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))) return false; /* If DEST is an SSA_NAME that flows from an abnormal edge, then it |