+2014-02-04 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-prop.c (detect_type_change): Shor circuit testing of
+ type changes on THIS pointer.
+
2014-02-04 John David Anglin <danglin@gcc.gnu.org>
PR target/59777
|| !BINFO_VTABLE (TYPE_BINFO (comp_type)))
return false;
+ /* C++ methods are not allowed to change THIS pointer unless they
+ are constructors or destructors. */
+ if (TREE_CODE (base) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME
+ && SSA_NAME_IS_DEFAULT_DEF (TREE_OPERAND (base, 0))
+ && TREE_CODE (SSA_NAME_VAR (TREE_OPERAND (base, 0))) == PARM_DECL
+ && TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE
+ && !DECL_CXX_CONSTRUCTOR_P (current_function_decl)
+ && !DECL_CXX_DESTRUCTOR_P (current_function_decl)
+ && (SSA_NAME_VAR (TREE_OPERAND (base, 0))
+ == DECL_ARGUMENTS (current_function_decl)))
+ return false;
+
ao_ref_init (&ao, arg);
ao.base = base;
ao.offset = offset;
/* Note that we miss one devirtualization because we are not able to track the
vtbl store in destructor.
Previously we devirtualized to C::m_fn1 instead of B::m_fn1. */
-/* { dg-final { scan-tree-dump-times "Discovered a virtual call to a known target" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */