* g++.dg/ipa/devirt-38.C: New testcase.
* tree-ssa-alias.c (walk_aliased_vdefs_1): Do not clear
function_entry_reached.
(walk_aliased_vdefs): Clear it here.
* ipa-devirt.c (check_stmt_for_type_change): Handle static storage.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213991
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-08-14 Jan Hubicka <hubicka@ucw.cz>
+ PR tree-optimization/62091
+ * tree-ssa-alias.c (walk_aliased_vdefs_1): Do not clear
+ function_entry_reached.
+ (walk_aliased_vdefs): Clear it here.
+ * ipa-devirt.c (check_stmt_for_type_change): Handle static storage.
+
+2014-08-14 Jan Hubicka <hubicka@ucw.cz>
+
* ipa-utils.h (compare_virtual_tables): Declare.
* ipa-devirt.c (odr_subtypes_equivalent_p): New function
* BITS_PER_UNIT;
op = TREE_OPERAND (op, 0);
}
+ else if (DECL_P (op))
+ ;
else
{
tci->speculative = true;
+2014-08-14 Jan Hubicka <hubicka@ucw.cz>
+
+ PR tree-optimization/62091
+ * g++.dg/ipa/devirt-38.C: New testcase.
+
2014-08-14 Marek Polacek <polacek@redhat.com>
DR 458
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+class SnmpSyntax
+{
+public:
+ virtual SnmpSyntax *m_fn1 () const;
+ ~SnmpSyntax () {}
+ virtual SnmpSyntax &operator=(const SnmpSyntax &);
+};
+
+class A : public SnmpSyntax
+{
+public:
+ A (int);
+ SnmpSyntax *m_fn1 () const {}
+ SnmpSyntax &operator=(const SnmpSyntax &);
+};
+int a;
+void fn1 ()
+{
+ for (;; a++)
+ switch (0)
+ case 0:
+ {
+ A b (0);
+ SnmpSyntax &c = b;
+ c.m_fn1 ();
+ }
+}
+// Devirtualization to A::m_fn1 would be possible, but we can not do it at the moment
bitmap *visited, unsigned int cnt,
bool *function_entry_reached)
{
- if (function_entry_reached)
- *function_entry_reached = false;
do
{
gimple def_stmt = SSA_NAME_DEF_STMT (vdef);
timevar_push (TV_ALIAS_STMT_WALK);
+ if (function_entry_reached)
+ *function_entry_reached = false;
+
ret = walk_aliased_vdefs_1 (ref, vdef, walker, data,
visited ? visited : &local_visited, 0,
function_entry_reached);