https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80842
Bug ID: 80842 Summary: gcc ICE at -O3 on x86_64-linux-gnu in "set_lattice_value" Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk at -O3 on x86_64-linux-gnu in both 32- and 64-bit modes. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 8.0.0 20170520 (experimental) [trunk revision 248308] (GCC) $ gcc-trunk -O3 abc.c abc.c: In function ‘fn3’: abc.c:10:6: internal compiler error: in set_lattice_value, at tree-ssa-ccp.c:505 void fn3() { ^~~ 0xc9efc8 set_lattice_value ../../gcc/gcc/tree-ssa-ccp.c:505 0xca3f2c visit_assignment ../../gcc/gcc/tree-ssa-ccp.c:2322 0xca40da ccp_visit_stmt ../../gcc/gcc/tree-ssa-ccp.c:2396 0xd2f518 simulate_stmt ../../gcc/gcc/tree-ssa-propagate.c:241 0xd30fb2 process_ssa_edge_worklist ../../gcc/gcc/tree-ssa-propagate.c:341 0xd30fb2 ssa_propagate(ssa_prop_result (*)(gimple*, edge_def**, tree_node**), ssa_prop_result (*)(gphi*)) ../../gcc/gcc/tree-ssa-propagate.c:813 0xc9de10 do_ssa_ccp ../../gcc/gcc/tree-ssa-ccp.c:2436 0xc9de10 execute ../../gcc/gcc/tree-ssa-ccp.c:2480 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ cat abc.c unsigned a; short b; char c, d, e; void fn1(); void fn2() { a++; for (; a;) fn1(0, 0); } void fn3() { fn2(); l1:; unsigned char f; short g; unsigned char *h = &f; g += &h ? e ? g = 1 : 0 : 0; d = g; c *f; if (d & (b %= *h) < f * d / (d -= 0)) goto l1; }