https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119226

            Bug ID: 119226
           Summary: [15 Regression] ICE on vifm-0.14: SIGSEGV during
                    GIMPLE pass: dom
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Originally noticed the ICE on vifm-0.14 on gcc-master from
r15-7972-gbc6bbdb2cbc3ac (did not bisect yet). Extracted reproducer:

// $ cat string_array.c.c
char break_into_lines_text;
int break_into_lines_null_sep;
char *break_into_lines_list;
unsigned long strcspn(char *, char *);
char **break_into_lines() {
  char *seps = break_into_lines_null_sep ? "" : "\n\r";
  long line_len = strcspn(&break_into_lines_text, seps);
  char *after_line = &break_into_lines_text + line_len;
  if (after_line[0])
    while (after_line)
      ;
  return &break_into_lines_list;
}

Crashing:

$ gcc/xgcc -Bgcc -c string_array.c.c -o bug.o -Wall -O2
during GIMPLE pass: dom
string_array.c.c: In function ‘break_into_lines’:
string_array.c.c:5:8: internal compiler error: Segmentation fault
    5 | char **break_into_lines() {
      |        ^~~~~~~~~~~~~~~~
0x2611911 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2624875 internal_error(char const*, ...)
        ???:0
0xfe8b77 crash_signal(int)
        ???:0
0x9b7d63 fold_builtin_n(unsigned long, tree_node*, tree_node*, tree_node**,
int, bool)
        ???:0
0x9b99ac fold_builtin_call_array(unsigned long, tree_node*, tree_node*, int,
tree_node**)
        ???:0
0xbf5d01 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*),
tree_node* (*)(tree_node*))
        ???:0
0x12b713c jt_state::register_equivs_stmt(gimple*, basic_block_def*,
jt_simplifier*)
        ???:0
0x12b7b42
jump_threader::record_temporary_equivalences_from_stmts_at_dest(edge_def*)
        ???:0
0x12b88db jump_threader::thread_through_normal_block(vec<jump_thread_edge*,
va_heap, vl_ptr>*, edge_def*, bitmap_head*, unsigned int&)
        ???:0
0x12b9903 jump_threader::thread_across_edge(edge_def*)
        ???:0
0x12b9d15 jump_threader::thread_outgoing_edges(basic_block_def*)
        ???:0
0x1174100 dom_opt_dom_walker::after_dom_children(basic_block_def*)
        ???:0
0x2307c30 dom_walker::walk(basic_block_def*)
        ???:0
0x11795a1 (anonymous namespace)::pass_dominator::execute(function*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer
--disable-libstdcxx-pch --enable-languages=c,c++ --disable-libgomp
--disable-libquadmath --disable-libvtv CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0'
LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.1 20250311 (experimental) (GCC)

Reply via email to