https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70190
Bug ID: 70190 Summary: ICE (segfault) at -O2 and -O3 on x86_64-linux-gnu Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk on x86_64-linux-gnu at -O2 and -O3 in both 32-bit and 64-bit modes. This is a regression from 5.3.x. $ 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/6.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 6.0.0 20160311 (experimental) [trunk revision 234134] (GCC) $ $ gcc-trunk -Os -c small.c $ gcc-5.3 -O2 -c small.c $ $ gcc-trunk -O2 -c small.c small.c: In function ‘fn1’: small.c:2:1: internal compiler error: Segmentation fault fn1 () ^~~ 0xb6627f crash_signal ../../gcc-source-trunk/gcc/toplev.c:335 0x12f6e42 fsm_find_control_statement_thread_paths ../../gcc-source-trunk/gcc/tree-ssa-threadbackward.c:390 0x12f75c2 find_jump_threads_backwards(edge_def*) ../../gcc-source-trunk/gcc/tree-ssa-threadbackward.c:544 0xd5acf5 thread_across_edge(gcond*, edge_def*, bool, const_and_copies*, avail_exprs_stack*, tree_node* (*)(gimple*, gimple*, avail_exprs_stack*)) ../../gcc-source-trunk/gcc/tree-ssa-threadedge.c:1027 0xc8cbf0 dom_opt_dom_walker::thread_across_edge(edge_def*) ../../gcc-source-trunk/gcc/tree-ssa-dom.c:989 0xc8cde9 dom_opt_dom_walker::after_dom_children(basic_block_def*) ../../gcc-source-trunk/gcc/tree-ssa-dom.c:1408 0x1221407 dom_walker::walk(basic_block_def*) ../../gcc-source-trunk/gcc/domwalk.c:307 0xc8f78b execute ../../gcc-source-trunk/gcc/tree-ssa-dom.c:614 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. $ ---------------------------------------- int fn1 () { static char a[] = "foo"; static void *b[] = { &&l1, &&l2 }; goto *(b[1]); l1: goto *(a[0]); l2: return 0; }