https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68305
Bug ID: 68305 Summary: ICE on valid code at -O3 on x86_64-linux-gnu: tree check: expected class ‘expression’, have ‘exceptional’ (ssa_name) in tree_operand_check, at tree.h:3436 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 at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 5.2.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-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20151110 (experimental) [trunk revision 230107] (GCC) $ $ gcc-trunk -O2 -c small.c $ gcc-5.2 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘fn1’: small.c:4:1: internal compiler error: tree check: expected class ‘expression’, have ‘exceptional’ (ssa_name) in tree_operand_check, at tree.h:3436 fn1 () ^ 0xd66987 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../gcc-trunk/gcc/tree.c:9638 0xd3f9c3 expr_check(tree_node*, char const*, int, char const*) ../../gcc-trunk/gcc/tree.h:3107 0xd3f9c3 tree_operand_check(tree_node*, int, char const*, int, char const*) ../../gcc-trunk/gcc/tree.h:3436 0xd3f9c3 vect_get_constant_vectors ../../gcc-trunk/gcc/tree-vect-slp.c:2744 0xd3fce1 vect_get_slp_defs(vec<tree_node*, va_heap, vl_ptr>, _slp_tree*, vec<vec<tree_node*, va_heap, vl_ptr>, va_heap, vl_ptr>*, int) ../../gcc-trunk/gcc/tree-vect-slp.c:3025 0xd0e5f9 vectorizable_condition(gimple*, gimple_stmt_iterator*, gimple**, tree_node*, int, _slp_tree*) ../../gcc-trunk/gcc/tree-vect-stmts.c:7389 0xd2137e vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*, _slp_instance*) ../../gcc-trunk/gcc/tree-vect-stmts.c:8020 0xd38ce4 vect_schedule_slp_instance ../../gcc-trunk/gcc/tree-vect-slp.c:3482 0xd38b39 vect_schedule_slp_instance ../../gcc-trunk/gcc/tree-vect-slp.c:3363 0xd3a8d6 vect_schedule_slp(vec_info*) ../../gcc-trunk/gcc/tree-vect-slp.c:3547 0xd275c5 vect_transform_loop(_loop_vec_info*) ../../gcc-trunk/gcc/tree-vect-loop.c:6619 0xd4254b vectorize_loops() ../../gcc-trunk/gcc/tree-vectorizer.c:533 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; void fn1 () { int c, d; for (; b; b++) a = a ^ !c ^ !d; }