diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 9f0733d8249..4fe2ebe1888 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,10 @@ +2015-12-08 Jan Hubicka + + PR lto/68811 + * lto.c (lto_fixup_prevailing_decls): Do not check TREE_CHAIN of + DECL. + (LTO_NO_PREVAIL): Use gcc_checking_assert. + 2015-12-08 Jan Hubicka PR lto/68811 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 90712b45ecb..1b11439f04f 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2517,7 +2517,7 @@ lto_wpa_write_files (void) /* Ensure that TT isn't a replacable var of function decl. */ #define LTO_NO_PREVAIL(tt) \ - gcc_assert (!(tt) || !VAR_OR_FUNCTION_DECL_P (tt)) + gcc_checking_assert (!(tt) || !VAR_OR_FUNCTION_DECL_P (tt)) /* Given a tree T replace all fields referring to variables or functions with their prevailing variant. */ @@ -2529,7 +2529,10 @@ lto_fixup_prevailing_decls (tree t) gcc_checking_assert (code != TREE_BINFO); LTO_NO_PREVAIL (TREE_TYPE (t)); - if (CODE_CONTAINS_STRUCT (code, TS_COMMON)) + if (CODE_CONTAINS_STRUCT (code, TS_COMMON) + /* lto_symtab_prevail_decl use TREE_CHAIN to link to the prevailing decl. + in the case T is a prevailed declaration we would ICE here. */ + && !VAR_OR_FUNCTION_DECL_P (t)) LTO_NO_PREVAIL (TREE_CHAIN (t)); if (DECL_P (t)) {