I don't understand why they vanish when still refered to, but
lets deal with that in a conservative way.
PR ipa/120146
* tree-ssa-structalias.cc (create_variable_info_for): If
the symtab cannot tell us whether all refs to a variable
are explicit assume they are not.
* g++.dg/ipa/pr120146.C: New testcase.
--- /dev/null
+// { dg-do compile }
+// { dg-options "-O -fipa-pta" }
+
+struct basic_ios {
+ ~basic_ios();
+};
+struct basic_istream : virtual basic_ios {};
+template <typename> struct basic_ifstream : basic_istream {
+ template <typename _Path> basic_ifstream(_Path, int);
+};
+extern template class basic_ifstream<char>;
+void CompareFiles_path2() { basic_ifstream<char>(CompareFiles_path2, 0); }
varpool_node *vnode = varpool_node::get (decl);
/* For escaped variables initialize them from nonlocal. */
- if (!vnode->all_refs_explicit_p ())
+ if (!vnode || !vnode->all_refs_explicit_p ())
make_copy_constraint (vi, nonlocal_id);
/* While we can in theory walk references for the varpool
process_constraint (new_constraint (lhs, *rhsp));
/* If this is a variable that escapes from the unit
the initializer escapes as well. */
- if (!vnode->all_refs_explicit_p ())
+ if (!vnode || !vnode->all_refs_explicit_p ())
{
lhs.var = escaped_id;
lhs.offset = 0;