diff options
author | Richard Guenther <rguenther@suse.de> | 2012-09-19 11:03:51 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-09-19 11:03:51 +0000 |
commit | ef78c9c7e6972b818db9c7d50cca1358ab303fdd (patch) | |
tree | 41d8dd94626e5a21d8c50126e2a27b744d399709 /gcc | |
parent | b5493fb2fa5972e79056247600874f4480c6f8ad (diff) | |
download | gcc-ef78c9c7e6972b818db9c7d50cca1358ab303fdd.zip gcc-ef78c9c7e6972b818db9c7d50cca1358ab303fdd.tar.gz gcc-ef78c9c7e6972b818db9c7d50cca1358ab303fdd.tar.bz2 |
tree-ssa-forwprop.c (get_prop_source_stmt): Simplify.
2012-09-19 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (get_prop_source_stmt): Simplify.
From-SVN: r191467
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 24 |
2 files changed, 9 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d00f3e2..c9d8012 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-19 Richard Guenther <rguenther@suse.de> + + * tree-ssa-forwprop.c (get_prop_source_stmt): Simplify. + 2012-09-19 Jan Hubicka <jh@suse.cz> * symtab.c (insert_to_assembler_name_hash): Do not insert diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index a162832..3b7991f 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); } |