Hi, This ICE appears because gcc will stream it to the function_body section when processing the variable with the initial value of the constructor type, and the error_mark_node to the decls section. When recompiling, the value obtained with DECL_INITIAL will be error_mark.
This patch use vnode->get_constructor () to get intial in lto. Bootstrap and tested on aarch64 Linux platform. Best regulars, Zekun gcc: +2020-04-29 Li Zekun <lizek...@huawei.com> + + PR lto/94822 + * tree.c: use vnode->get_constructor () to get intial in lto gcc/testsuite: +2020-04-29 Li Zekun <lizek...@huawei.com> + + PR lto/94822 + * gcc.dg/lto/pr94822.h: New test. + * gcc.dg/lto/pr94822_0.c: New test. + * gcc.dg/lto/pr94822_1.c: New test.
attachment.obj
Description: attachment.obj