Commit fdc2de95 by Richard Guenther Committed by Richard Biener

tree-ssa-copy.c (stmt_may_generate_copy): Copies from constants also generate copies.

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.

From-SVN: r171465
parent 21385db0
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> 2011-03-25 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (mem_loc_descriptor) <case ZERO_EXTRACT>: Compare * dwarf2out.c (mem_loc_descriptor) <case ZERO_EXTRACT>: Compare
......
...@@ -315,8 +315,9 @@ stmt_may_generate_copy (gimple stmt) ...@@ -315,8 +315,9 @@ stmt_may_generate_copy (gimple stmt)
/* Otherwise, the only statements that generate useful copies are /* Otherwise, the only statements that generate useful copies are
assignments whose RHS is just an SSA name that doesn't flow assignments whose RHS is just an SSA name that doesn't flow
through abnormal edges. */ through abnormal edges. */
return (gimple_assign_rhs_code (stmt) == SSA_NAME return ((gimple_assign_rhs_code (stmt) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs1 (stmt))); && !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) ...@@ -771,6 +772,7 @@ fini_copy_prop (void)
of the representative to the first solution we find if of the representative to the first solution we find if
it doesn't have one already. */ it doesn't have one already. */
if (copy_of[i].value != var if (copy_of[i].value != var
&& TREE_CODE (copy_of[i].value) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (var)) && POINTER_TYPE_P (TREE_TYPE (var))
&& SSA_NAME_PTR_INFO (var) && SSA_NAME_PTR_INFO (var)
&& !SSA_NAME_PTR_INFO (copy_of[i].value)) && !SSA_NAME_PTR_INFO (copy_of[i].value))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment