Commit 0004f992 by Martin Jambor Committed by Martin Jambor

ipa-prop.c (stmt_may_be_vtbl_ptr_store): Return false for scalar non-pointer assignments.

2011-04-19  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.c (stmt_may_be_vtbl_ptr_store): Return false for scalar
	non-pointer assignments.

From-SVN: r172717
parent 40591473
2011-04-19 Martin Jambor <mjambor@suse.cz> 2011-04-19 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (stmt_may_be_vtbl_ptr_store): Return false for scalar
non-pointer assignments.
2011-04-19 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (ipcp_process_devirtualization_opportunities): Take into * ipa-cp.c (ipcp_process_devirtualization_opportunities): Take into
account anc_offset and otr_type from the indirect edge info. account anc_offset and otr_type from the indirect edge info.
* ipa-prop.c (get_ancestor_addr_info): New function. * ipa-prop.c (get_ancestor_addr_info): New function.
......
...@@ -405,13 +405,19 @@ stmt_may_be_vtbl_ptr_store (gimple stmt) ...@@ -405,13 +405,19 @@ stmt_may_be_vtbl_ptr_store (gimple stmt)
{ {
tree lhs = gimple_assign_lhs (stmt); tree lhs = gimple_assign_lhs (stmt);
if (TREE_CODE (lhs) == COMPONENT_REF if (!AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
&& !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1)) {
&& !AGGREGATE_TYPE_P (TREE_TYPE (lhs))) if (flag_strict_aliasing
&& !POINTER_TYPE_P (TREE_TYPE (lhs)))
return false;
if (TREE_CODE (lhs) == COMPONENT_REF
&& !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1)))
return false; return false;
/* In the future we might want to use get_base_ref_and_offset to find /* In the future we might want to use get_base_ref_and_offset to find
if there is a field corresponding to the offset and if so, proceed if there is a field corresponding to the offset and if so, proceed
almost like if it was a component ref. */ almost like if it was a component ref. */
}
} }
return true; return true;
} }
......
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