aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-04-19 18:19:13 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2011-04-19 18:19:13 +0200
commit0004f992f087081cab0f22574347d2d97ea698c1 (patch)
tree358145d64e505393362b5895a0a43f61bcbcb3df /gcc/ipa-prop.c
parent405914731a9a06617eadb4dc604d0fe5e901fc76 (diff)
downloadgcc-0004f992f087081cab0f22574347d2d97ea698c1.zip
gcc-0004f992f087081cab0f22574347d2d97ea698c1.tar.gz
gcc-0004f992f087081cab0f22574347d2d97ea698c1.tar.bz2
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
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index c482165..6620d57 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;
}