Commit 375c3b86 by Jan Hubicka Committed by Jan Hubicka

re PR lto/87997 (ICE in cp_var_mod_type_p at gcc/cp/cp-objcp-common.c:107 since r265870)


	PR lto/87997
	* tree.c (free_lang_data_in_cgraph): Add argument fld; break out
	type checking to...
	(free_lang_data) ... here; update call of free_lang_data_in_cgraph.

From-SVN: r266316
parent 12485662
2018-11-20 Jan Hubicka <hubicka@ucw.cz>
PR lto/87997
* tree.c (free_lang_data_in_cgraph): Add argument fld; break out
type checking to...
(free_lang_data) ... here; update call of free_lang_data_in_cgraph.
2018-11-20 Jan Hubicka <hubicka@ucw.cz>
PR ipa/87706
* ipa-fnsummary.c (pass_ipa_fnsummary): Do not remove functions
* ipa.c (possible_inline_candidate_p): Break out from ..
/* { dg-do compile } */
template <typename, typename> struct a;
template <template <typename> class b, typename c, typename f, typename... d>
struct a<b<f, d...>, c> {
using e = b<c>;
};
template <typename f> class h {
public:
typedef f g;
};
template <typename j, typename c> using k = typename a<j, c>::e;
template <typename j> struct l { template <typename f> using m = k<j, f>; };
template <typename j> struct n {
typedef typename j::g o;
template <typename f> struct p {
typedef typename l<j>::template m<f> other;
};
};
template <typename f, typename j> struct F {
typedef typename n<j>::template p<f>::other q;
};
template <typename f, typename j = h<f>> class r {
public:
typename n<typename F<f, j>::q>::o operator[](long);
f *t() noexcept;
};
class s {
void m_fn2();
r<int (s::*)()> u;
};
void s::m_fn2() try {
for (int i;;)
(this->*u[i])();
} catch (...) {
}
......@@ -6021,44 +6021,38 @@ assign_assembler_name_if_needed (tree t)
been set up. */
static void
free_lang_data_in_cgraph (void)
free_lang_data_in_cgraph (struct free_lang_data_d *fld)
{
struct cgraph_node *n;
varpool_node *v;
struct free_lang_data_d fld;
tree t;
unsigned i;
alias_pair *p;
/* Find decls and types in the body of every function in the callgraph. */
FOR_EACH_FUNCTION (n)
find_decls_types_in_node (n, &fld);
find_decls_types_in_node (n, fld);
FOR_EACH_VEC_SAFE_ELT (alias_pairs, i, p)
find_decls_types (p->decl, &fld);
find_decls_types (p->decl, fld);
/* Find decls and types in every varpool symbol. */
FOR_EACH_VARIABLE (v)
find_decls_types_in_var (v, &fld);
find_decls_types_in_var (v, fld);
/* Set the assembler name on every decl found. We need to do this
now because free_lang_data_in_decl will invalidate data needed
for mangling. This breaks mangling on interdependent decls. */
FOR_EACH_VEC_ELT (fld.decls, i, t)
FOR_EACH_VEC_ELT (fld->decls, i, t)
assign_assembler_name_if_needed (t);
/* Traverse every decl found freeing its language data. */
FOR_EACH_VEC_ELT (fld.decls, i, t)
free_lang_data_in_decl (t, &fld);
FOR_EACH_VEC_ELT (fld->decls, i, t)
free_lang_data_in_decl (t, fld);
/* Traverse every type found freeing its language data. */
FOR_EACH_VEC_ELT (fld.types, i, t)
free_lang_data_in_type (t, &fld);
if (flag_checking)
{
FOR_EACH_VEC_ELT (fld.types, i, t)
verify_type (t);
}
FOR_EACH_VEC_ELT (fld->types, i, t)
free_lang_data_in_type (t, fld);
}
......@@ -6068,6 +6062,7 @@ static unsigned
free_lang_data (void)
{
unsigned i;
struct free_lang_data_d fld;
/* If we are the LTO frontend we have freed lang-specific data already. */
if (in_lto_p
......@@ -6088,7 +6083,7 @@ free_lang_data (void)
/* Traverse the IL resetting language specific information for
operands, expressions, etc. */
free_lang_data_in_cgraph ();
free_lang_data_in_cgraph (&fld);
/* Create gimple variants for common types. */
for (unsigned i = 0;
......@@ -6109,6 +6104,15 @@ free_lang_data (void)
lang_hooks.tree_inlining.var_mod_type_p = hook_bool_tree_tree_false;
if (flag_checking)
{
int i;
tree t;
FOR_EACH_VEC_ELT (fld.types, i, t)
verify_type (t);
}
/* We do not want the default decl_assembler_name implementation,
rather if we have fixed everything we want a wrapper around it
asserting that all non-local symbols already got their assembler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment