diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-19 16:19:13 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-19 16:19:13 +0000 |
commit | cf3b9c67844a8a36522333514a967d564fe3795a (patch) | |
tree | 358145d64e505393362b5895a0a43f61bcbcb3df | |
parent | 09a2b4db6f3c3fdf6622e243208fee3be2933579 (diff) | |
download | gcc-cf3b9c67844a8a36522333514a967d564fe3795a.tar.gz |
2011-04-19 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (stmt_may_be_vtbl_ptr_store): Return false for scalar
non-pointer assignments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172717 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7ada452d6ef..785980d91d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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 account anc_offset and otr_type from the indirect edge info. * ipa-prop.c (get_ancestor_addr_info): New function. diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index c482165a6f3..6620d5791cd 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -405,13 +405,19 @@ stmt_may_be_vtbl_ptr_store (gimple stmt) { tree lhs = gimple_assign_lhs (stmt); - if (TREE_CODE (lhs) == COMPONENT_REF - && !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1)) - && !AGGREGATE_TYPE_P (TREE_TYPE (lhs))) + if (!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; - /* 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 - almost like if it was a component ref. */ + /* 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 + almost like if it was a component ref. */ + } } return true; } |