diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-25 16:28:15 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-25 16:28:15 +0000 |
commit | f82efd77cef80a0ebd1b6e4b26e10eb4bccfc36f (patch) | |
tree | 6c641cdf9034b10c106fafd059cbad19f6710d89 /gcc | |
parent | ed0d805ade476b6cada7b87820b349061b78d445 (diff) | |
download | gcc-f82efd77cef80a0ebd1b6e4b26e10eb4bccfc36f.tar.gz |
2011-03-25 Richard Guenther <rguenther@suse.de>
* tree-ssa-copy.c (stmt_may_generate_copy): Copies from constants
also generate copies.
(fini_copy_prop): Handle constant values properly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171465 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-copy.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62299ae1a02..588651d7fa0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-25 Richard Guenther <rguenther@suse.de> + + * tree-ssa-copy.c (stmt_may_generate_copy): Copies from constants + also generate copies. + (fini_copy_prop): Handle constant values properly. + 2011-03-25 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (mem_loc_descriptor) <case ZERO_EXTRACT>: Compare diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index 8062c033697..dbcbf9e5905 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -315,8 +315,9 @@ stmt_may_generate_copy (gimple stmt) /* Otherwise, the only statements that generate useful copies are assignments whose RHS is just an SSA name that doesn't flow through abnormal edges. */ - return (gimple_assign_rhs_code (stmt) == SSA_NAME - && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs1 (stmt))); + return ((gimple_assign_rhs_code (stmt) == SSA_NAME + && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs1 (stmt))) + || is_gimple_min_invariant (gimple_assign_rhs1 (stmt))); } @@ -771,6 +772,7 @@ fini_copy_prop (void) of the representative to the first solution we find if it doesn't have one already. */ if (copy_of[i].value != var + && TREE_CODE (copy_of[i].value) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (var)) && SSA_NAME_PTR_INFO (var) && !SSA_NAME_PTR_INFO (copy_of[i].value)) |