https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71981
Bug ID: 71981 Summary: ICE at -O2 and -O3 on x86_64-linux-gnu (internal compiler error: in get_dynamic_type, at ipa-polymorphic-call.c:1667) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160722 (experimental) [trunk revision 238670] (GCC) $ $ gcc-trunk -c -w -O2 small.c small.c: In function ‘main’: small.c:7:1: internal compiler error: in get_dynamic_type, at ipa-polymorphic-call.c:1667 int main() { fn1(""); return 0; } ^~~ 0x9de9ae ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*, tree_node*, gimple*) ../../gcc-source-trunk/gcc/ipa-polymorphic-call.c:1667 0x9feb91 ipa_compute_jump_functions_for_edge ../../gcc-source-trunk/gcc/ipa-prop.c:1651 0x9feb91 ipa_compute_jump_functions_for_bb ../../gcc-source-trunk/gcc/ipa-prop.c:1765 0x9feb91 analysis_dom_walker::before_dom_children(basic_block_def*) ../../gcc-source-trunk/gcc/ipa-prop.c:2283 0x12319c2 dom_walker::walk(basic_block_def*) ../../gcc-source-trunk/gcc/domwalk.c:265 0xa024ec ipa_analyze_node(cgraph_node*) ../../gcc-source-trunk/gcc/ipa-prop.c:2353 0x128c3af ipcp_generate_summary ../../gcc-source-trunk/gcc/ipa-cp.c:4655 0xaf751e execute_ipa_summary_passes(ipa_opt_pass_d*) ../../gcc-source-trunk/gcc/passes.c:2170 0x7ec838 ipa_passes ../../gcc-source-trunk/gcc/cgraphunit.c:2295 0x7ec838 symbol_table::compile() ../../gcc-source-trunk/gcc/cgraphunit.c:2409 0x7eea97 symbol_table::compile() ../../gcc-source-trunk/gcc/cgraphunit.c:2543 0x7eea97 symbol_table::finalize_compilation_unit() ../../gcc-source-trunk/gcc/cgraphunit.c:2569 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. $ $ cat small.c int **a; static void fn1(char **p1) { char s = *p1, b = &s; while (*fn2()[a]) ; } int main() { fn1(""); return 0; } $