https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65722
Bug ID: 65722 Summary: [5 Regression] ICE: tree check: expected function_decl, have var_decl in equals_wpa, at ipa-icf.c:1679 with -fipa-icf -fno-rtti Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Created attachment 35280 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35280&action=edit reduced testcase Compiler output: $ gcc -O -fipa-icf -fno-rtti testcase.C testcase.C:18:1: internal compiler error: tree check: expected function_decl, have var_decl in equals_wpa, at ipa-icf.c:1679 } ^ 0x10802bc tree_check_failed(tree_node const*, char const*, int, char const*, ...) /mnt/svn/gcc-trunk/gcc/tree.c:9297 0x1893327 tree_check(tree_node*, char const*, int, char const*, tree_code) /mnt/svn/gcc-trunk/gcc/tree.h:2846 0x1893327 ipa_icf::sem_variable::equals_wpa(ipa_icf::sem_item*, hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&) /mnt/svn/gcc-trunk/gcc/ipa-icf.c:1679 0x188f0b2 ipa_icf::sem_item_optimizer::subdivide_classes_by_equality(bool) /mnt/svn/gcc-trunk/gcc/ipa-icf.c:2657 0x189a4ea ipa_icf::sem_item_optimizer::execute() /mnt/svn/gcc-trunk/gcc/ipa-icf.c:2405 0x189bf56 ipa_icf_driver /mnt/svn/gcc-trunk/gcc/ipa-icf.c:3306 0x189bf56 ipa_icf::pass_ipa_icf::execute(function*) /mnt/svn/gcc-trunk/gcc/ipa-icf.c:3353 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ gcc -v Using built-in specs. COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-221940-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df --enable-languages=c,c++,lto,fortran --prefix=/mnt/svn/gcc-trunk/binary-221940-lto-fortran-checking-yes-rtl-df/ --without-cloog --without-ppl Thread model: posix gcc version 5.0.0 20150409 (experimental) (GCC) Marking as regression since "-O2 -fno-rtti" triggers the issue.