https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78788
Bug ID: 78788 Summary: [7 Regression] ICE (segfault) on s390x-linux-gnu Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: doko at gcc dot gnu.org Target Milestone: --- Created attachment 40319 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40319&action=edit unreduced test case seen with r243559 on s390x-linux-gnu, cc1 eats up all memory and then is killed. works with -O1. also seen on powerpc64le-linux-gnu. $ gdb --args /usr/lib/gcc/s390x-linux-gnu/7/cc1 -fpreprocessed ghosts.i -quiet -dumpbase ghosts.i -march=zEC12 -m64 -mzarch -auxbase ghosts -O2 -Wno-format-security -version -fno-aggressive-loop-optimizations -fstack-protector-strong -Wformat -o /tmp/ccaLbok3.s #0 sext_hwi (prec=<optimized out>, src=<optimized out>) at ../../src/gcc/hwint.h:292 #1 wide_int_storage::set_len (is_sign_extended=false, l=1, this=0x3ffffffd558) at ../../src/gcc/wide-int.h:1090 #2 wi::mask (precision=32, negate_p=false, width=31) at ../../src/gcc/wide-int.h:3200 #3 wi::max_value (precision=precision@entry=32, sgn=sgn@entry=SIGNED) at ../../src/gcc/wide-int.cc:326 #4 0x000000000199056e in generic_simplify_92 (loc=loc@entry=0, type=type@entry=0x3fffd513b28, op1=op1@entry=0x3fffc8d0408, captures=captures@entry=0x3ffffffd6a8, cmp=cmp@entry=GE_EXPR, op0=0x3fffc96f630) at generic-match.c:3761 #5 0x000000000199482c in generic_simplify_GE_EXPR (loc=<optimized out>, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffc8d0408, code=GE_EXPR) at generic-match.c:27866 #6 0x00000000019b8d92 in generic_simplify (loc=loc@entry=0, code=code@entry=GE_EXPR, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffc8d0408) at generic-match.c:33804 #7 0x00000000013a8386 in fold_binary_loc (loc=loc@entry=0, code=code@entry=GE_EXPR, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffc8d0408) at ../../src/gcc/fold-const.c:9055 #8 0x00000000013af5e2 in fold_build2_stat_loc (loc=loc@entry=0, code=code@entry=GE_EXPR, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffc8d0408) at ../../src/gcc/fold-const.c:12183 #9 0x000000000198adbc in generic_simplify_174 (loc=loc@entry=0, type=type@entry=0x3fffd513b28, captures=captures@entry=0x3ffffffdd10, acmp=acmp@entry=GE_EXPR, cmp=GT_EXPR, op1=0x3fffd501ba0, op0=0x3fffc96f630) at generic-match.c:7226 #10 0x00000000019957a6 in generic_simplify_GT_EXPR (loc=<optimized out>, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffd501ba0, code=GT_EXPR) at generic-match.c:28230 #11 0x00000000019b8dac in generic_simplify (loc=loc@entry=0, code=code@entry=GT_EXPR, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffd501ba0) at generic-match.c:33806 #12 0x00000000013a8386 in fold_binary_loc (loc=loc@entry=0, code=code@entry=GT_EXPR, type=type@entry=0x3fffd513b28, op0=op0@entry=0x3fffc96f630, op1=op1@entry=0x3fffd501ba0) at ../../src/gcc/fold-const.c:9055 #13 0x00000000013af5e2 in fold_build2_stat_loc (loc=<optimized out>, code=<optimized out>, type=0x3fffd513b28, op0=0x3fffc96f630, op1=0x3fffd501ba0) at ../../src/gcc/fold-const.c:12183 #14 0x00000000013a833c in fold_binary_loc (loc=loc@entry=0, code=LT_EXPR, type=0x3fffd513b28, op0=op0@entry=0x3fffd501ba0, op1=op1@entry=0x3fffc96f630) at ../../src/gcc/fold-const.c:9053 #15 0x00000000013bd2ee in fold_binary_to_constant (code=code@entry=LT_EXPR, type=<optimized out>, op0=op0@entry=0x3fffd501ba0, op1=op1@entry=0x3fffc96f630) at ../../src/gcc/fold-const.c:13533 #16 0x000000000183fb7e in operand_less_p (val=0x3fffd501ba0, val2=0x3fffc96f630) at ../../src/gcc/tree-vrp.c:1187 #17 0x000000000184461e in intersect_ranges (vr1max=0x3fffd501bb8, vr1min=0x3fffd501ba0, vr1type=VR_RANGE, vr0max=0x3ffffffe8b8, vr0min=0x3ffffffe8b0, vr0type=0x3ffffffe8a8) at ../../src/gcc/tree-vrp.c:8536 #18 vrp_intersect_ranges_1 (vr1=0x3ffffffe788, vr0=0x3ffffffe8a8) at ../../src/gcc/tree-vrp.c:8653 #19 vrp_intersect_ranges (vr0=0x3ffffffe8a8, vr1=0x3ffffffe788) at ../../src/gcc/tree-vrp.c:8691 #20 0x0000000001844c3e in update_value_range (var=0x3fffc85ff78, new_vr=0x3ffffffe8a8) at ../../src/gcc/tree-vrp.c:802 #21 0x0000000001854928 in vrp_visit_phi_node (phi=<optimized out>) at ../../src/gcc/tree-vrp.c:9024 #22 0x0000000001785042 in simulate_stmt (stmt=stmt@entry=0x3fffc85ab00) #23 0x0000000001786174 in process_ssa_edge_worklist () at ../../src/gcc/tree-ssa-propagate.c:341 #24 ssa_propagate (visit_stmt=visit_stmt@entry=0x1857b50 <vrp_visit_stmt(gimple*, edge*, tree*)>, visit_phi=visit_phi@entry=0x18548f8 <vrp_visit_phi_node(gphi*)>) at ../../src/gcc/tree-ssa-propagate.c:813 #25 0x000000000184e714 in execute_vrp (warn_array_bounds_p=false) at ../../src/gcc/tree-vrp.c:11247 #26 (anonymous namespace)::pass_vrp::execute (this=<optimized out>) at ../../src/gcc/tree-vrp.c:11334 #27 0x000000000156c8f6 in execute_one_pass (pass=pass@entry=0x212ac50) at ../../src/gcc/passes.c:2370 #28 0x000000000156cf82 in execute_pass_list_1 (pass=0x212ac50) at ../../src/gcc/passes.c:2459 #29 0x000000000156cf9e in execute_pass_list_1 (pass=0x212a6f0) at ../../src/gcc/passes.c:2460 #30 0x000000000156cff2 in execute_pass_list (fn=<optimized out>, pass=<optimized out>) at ../../src/gcc/passes.c:2470 #31 0x00000000012bc33a in cgraph_node::expand (this=this@entry=0x3fffd1f3730) at ../../src/gcc/cgraphunit.c:2001 #32 0x00000000012bd7c0 in expand_all_functions () at ../../src/gcc/cgraphunit.c:2137 #33 symbol_table::compile (this=this@entry=0x3fffd505000) at ../../src/gcc/cgraphunit.c:2494 #34 0x00000000012bf672 in symbol_table::compile (this=0x3fffd505000) at ../../src/gcc/cgraphunit.c:2587 #35 symbol_table::finalize_compilation_unit (this=0x3fffd505000) at ../../src/gcc/cgraphunit.c:2584 #36 0x0000000001633cf4 in compile_file () at ../../src/gcc/toplev.c:488 #37 0x000000000117f5ce in do_compile () at ../../src/gcc/toplev.c:1983 #38 toplev::main (this=this@entry=0x3fffffff27e, argc=<optimized out>, argc@entry=19, argv=<optimized out>, argv@entry=0x3fffffff4a8) at ../../src/gcc/toplev.c:2117 #39 0x0000000001180fb8 in main (argc=<optimized out>, argv=0x3fffffff4a8) at ../../src/gcc/main.c:39