summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-19 11:03:51 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-19 11:03:51 +0000
commitab31ca23c6e4af8da349ad9e02cdae9ab4612c31 (patch)
tree41d8dd94626e5a21d8c50126e2a27b744d399709 /gcc/tree-ssa-forwprop.c
parentc9aa64535850aea75f19172b655ded1c72392c6d (diff)
downloadgcc-ab31ca23c6e4af8da349ad9e02cdae9ab4612c31.tar.gz
2012-09-19 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (get_prop_source_stmt): Simplify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index a1628327a84..3b7991f8a1d 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -227,29 +227,15 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
if (!is_gimple_assign (def_stmt))
return NULL;
- /* If def_stmt is not a simple copy, we possibly found it. */
- if (!gimple_assign_ssa_name_copy_p (def_stmt))
+ /* If def_stmt is a simple copy, continue looking. */
+ if (gimple_assign_rhs_code (def_stmt) == SSA_NAME)
+ name = gimple_assign_rhs1 (def_stmt);
+ else
{
- tree rhs;
-
if (!single_use_only && single_use_p)
*single_use_p = single_use;
- /* We can look through pointer conversions in the search
- for a useful stmt for the comparison folding. */
- rhs = gimple_assign_rhs1 (def_stmt);
- if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
- && TREE_CODE (rhs) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (def_stmt)))
- && POINTER_TYPE_P (TREE_TYPE (rhs)))
- name = rhs;
- else
- return def_stmt;
- }
- else
- {
- /* Continue searching the def of the copy source name. */
- name = gimple_assign_rhs1 (def_stmt);
+ return def_stmt;
}
} while (1);
}