commit 443712c075426eec018222b0147f7f5350f3c0b3 Author: Maxim Kuvyrkov Date: Thu Mar 17 08:27:33 2011 -0700 Improve detect_type_change diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 3e56e70..491bb11 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -320,6 +320,7 @@ stmt_may_be_vtbl_ptr_store (gimple stmt) else if (is_gimple_assign (stmt)) { tree lhs = gimple_assign_lhs (stmt); + tree rhs; if (!AGGREGATE_TYPE_P (TREE_TYPE (lhs))) { @@ -334,6 +335,13 @@ stmt_may_be_vtbl_ptr_store (gimple stmt) if there is a field corresponding to the offset and if so, proceed almost like if it was a component ref. */ } + + /* Assume that only ADDR_EXPRs can be assigned to vtables. + In particular, ignore *ptr = when searching for aliasing + entries. */ + rhs = gimple_assign_rhs1 (stmt); + if (TREE_CODE (rhs) != ADDR_EXPR) + return false; } return true; }