https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64563
Bug ID: 64563 Summary: ICE with "-Wall -Wextra" at -Os and above on x86_64-linux-gnu Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled using the current gcc trunk with "-Wall -Wextra" at -Os and above on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 4.9.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 5.0.0 20150111 (experimental) [trunk revision 219429] (GCC) $ $ gcc-trunk -Os -c small.c $ gcc-4.9 -Wall -Wextra -Os -c small.c small.c: In function ‘fn1’: small.c:7:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] d = b = (a != (e | 4294967288UL)); ^ $ $ gcc-trunk -Wall -Wextra -Os -c small.c small.c: In function ‘fn1’: small.c:7:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] d = b = (a != (e | 4294967288UL)); ^ small.c:5:1: internal compiler error: Segmentation fault fn1 () ^ 0xa9896f crash_signal ../../gcc-trunk/gcc/toplev.c:372 0xce9a44 contains_struct_check(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc-trunk/gcc/tree.h:3128 0xce9a44 vrp_val_is_min ../../gcc-trunk/gcc/tree-vrp.c:241 0xcf0094 vrp_evaluate_conditional ../../gcc-trunk/gcc/tree-vrp.c:7550 0xd06454 fold_predicate_in ../../gcc-trunk/gcc/tree-vrp.c:9958 0xd06454 vrp_fold_stmt ../../gcc-trunk/gcc/tree-vrp.c:10001 0xc2c3d3 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*) ../../gcc-trunk/gcc/tree-ssa-propagate.c:1148 0x10ad7e7 dom_walker::walk(basic_block_def*) ../../gcc-trunk/gcc/domwalk.c:188 0xc2bcf0 substitute_and_fold(tree_node* (*)(tree_node*), bool (*)(gimple_stmt_iterator*), bool) ../../gcc-trunk/gcc/tree-ssa-propagate.c:1236 0xd033f4 vrp_finalize ../../gcc-trunk/gcc/tree-vrp.c:10189 0xd033f4 execute_vrp ../../gcc-trunk/gcc/tree-vrp.c:10305 0xd033f4 execute ../../gcc-trunk/gcc/tree-vrp.c:10384 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 a, b, c, d, f; unsigned int e; void fn1 () { d = b = (a != (e | 4294967288UL)); if (!d) c = f || b; }