https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77778
Bug ID: 77778 Summary: ICE at -Os and above on x86_64-linux-gnu in both 32-bit and 64-bit modes (Segmentation fault, visit_reference_op_store, extract_and_process_scc_for_name) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization 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 20160928 (experimental) [trunk revision 240565] (GCC) $ $ gcc-trunk -O3 small.c small.c: In function ‘main’: small.c:5:5: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] c = &a; ^ small.c:4:5: internal compiler error: Segmentation fault int main() { ^~~~ 0xbd143f crash_signal ../../gcc-source-trunk/gcc/toplev.c:337 0xda517d visit_reference_op_store ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:3613 0xda517d visit_use ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:3858 0xda675c process_scc ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:4111 0xda675c extract_and_process_scc_for_name ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:4198 0xda675c DFS ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:4250 0xda6e55 sccvn_dom_walker::before_dom_children(basic_block_def*) ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:4716 0x128aed7 dom_walker::walk(basic_block_def*) ../../gcc-source-trunk/gcc/domwalk.c:265 0xda8532 run_scc_vn(vn_lookup_kind) ../../gcc-source-trunk/gcc/tree-ssa-sccvn.c:4827 0xd7d345 execute ../../gcc-source-trunk/gcc/tree-ssa-pre.c:5021 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 static const int a; int b; int *c, *d; int main() { c = &a; c == d ?: __builtin_abort(); for (; b; b++ >= (*d = a)) ; return 0; } $