http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46288
Summary: ICE: SIGSEGV in walk_gimple_op (gimple.c:2857) with -O -fno-tree-dce and __builtin_expect() Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: zso...@seznam.cz ----- testcase.c ----- void foo (int i) { __builtin_expect (i, i); } ---------------------- Valgrind output (4.6 and 4.5): $ gcc -O -fno-tree-dce testcase.c ==12204== Invalid read of size 8 ==12204== at 0x6E6CF6: walk_gimple_op (gimple.c:2857) ==12204== by 0x89C342: verify_stmts (tree-cfg.c:4143) ==12204== by 0x9B943C: verify_ssa (tree-ssa.c:878) ==12204== by 0x794CCC: execute_function_todo (passes.c:1248) ==12204== by 0x79536E: execute_todo (passes.c:1277) ==12204== by 0x7979D9: execute_one_pass (passes.c:1583) ==12204== by 0x797C04: execute_pass_list (passes.c:1615) ==12204== by 0x797C16: execute_pass_list (passes.c:1616) ==12204== by 0x8E3FD5: tree_rest_of_compilation (tree-optimize.c:422) ==12204== by 0xAB0C31: cgraph_expand_function (cgraphunit.c:1494) ==12204== by 0xAB31F9: cgraph_optimize (cgraphunit.c:1553) ==12204== by 0xAB3759: cgraph_finalize_compilation_unit (cgraphunit.c:1016) ==12204== Address 0x10 is not stack'd, malloc'd or (recently) free'd ==12204== testcase.c: In function 'foo': testcase.c:1:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Compiler output (4.4): $ gcc -O -fno-tree-dce testcase.c testcase.c: In function 'foo': testcase.c:1: internal compiler error: in gimple_assign_set_lhs, at gimple.h:1687 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r166218 - crash 4.5 r165781 - crash 4.4 r165781 - different crash