-2014-12-14 Jan HUbicka <hubicka@ucw.cz>
+2014-12-14 Jan Hubicka <hubicka@ucw.cz>
+
+ * cgraphunit.c (analyze_functions): Always analyze targets of aliases.
+
+2014-12-14 Jan Hubicka <hubicka@ucw.cz>
+
+ PR lto/64043
+ * tree.c (virtual_method_call_p): Return false when OTR type has
+ no BINFO.
+
+2014-12-14 Jan Hubicka <hubicka@ucw.cz>
* cgraphunit.c (analyze_functions): Do not analyze extern inline
funtions when not optimizing; skip comdat locals.
+2014-12-14 Jan HUbicka <hubicka@ucw.cz>
+
+ PR lto/64043
+ * g++.dg/lto/pr64043_0.C: New testcase.
+
2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
PR rtl-optimization/64037
--- /dev/null
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -std=c++11 } } }
+// { dg-extra-ld-options "-r -nostdlib -O2" }
+class Validator
+{
+public:
+ virtual ~Validator ();
+};
+class FooWriter
+{
+ Validator *validator;
+ ~FooWriter ();
+};
+FooWriter::~FooWriter () { delete validator; }
{
if (TREE_CODE (target) != OBJ_TYPE_REF)
return false;
- target = TREE_TYPE (target);
- gcc_checking_assert (TREE_CODE (target) == POINTER_TYPE);
- target = TREE_TYPE (target);
- if (TREE_CODE (target) == FUNCTION_TYPE)
+ tree t = TREE_TYPE (target);
+ gcc_checking_assert (TREE_CODE (t) == POINTER_TYPE);
+ t = TREE_TYPE (t);
+ if (TREE_CODE (t) == FUNCTION_TYPE)
+ return false;
+ gcc_checking_assert (TREE_CODE (t) == METHOD_TYPE);
+ /* If we do not have BINFO associated, it means that type was built
+ without devirtualization enabled. Do not consider this a virtual
+ call. */
+ if (!TYPE_BINFO (obj_type_ref_class (target)))
return false;
- gcc_checking_assert (TREE_CODE (target) == METHOD_TYPE);
return true;
}