Bug 112321 - [14 Regression] ICE during GIMPLE pass: dse: : Segmentation fault
Summary: [14 Regression] ICE during GIMPLE pass: dse: : Segmentation fault
Status: RESOLVED DUPLICATE of bug 112320
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-31 19:27 UTC by Sergei Trofimovich
Modified: 2023-10-31 19:46 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich 2023-10-31 19:27:07 UTC
Noticed ICE on today's gcc-master at r14-5043-g2b19c387696b0d. There it fails to build binutils' gold. Extracted sample:

// $ cat bug.cc

void writeval(unsigned char *, long);
unsigned do_write_count;
void do_write() {
  unsigned char *pov;
  int limit(do_write_count > 8 ? true : do_write_count);
  for (int i = 0; i < limit; ++i)
    pov += 2;
  int ext_cnt = do_write_count - 8;
  for (; 0 < ext_cnt;) {
    writeval(pov, 0);
    pov += 4;
    ext_cnt--;
  }
}

Crashing:

$ gcc/xg++ -B./gcc -g -O1 -c bug.cc -o a.o
during GIMPLE pass: dse
bug.cc: In function ‘void do_write()’:
bug.cc:3:6: internal compiler error: Segmentation fault
    3 | void do_write() {
      |      ^~~~~~~~
0x8ebef5a crash_signal
        gcc/toplev.cc:315
0x8b42800 phi_nodes_ptr(basic_block_def*)
        gcc/gimple.h:4700
0x8b42800 gsi_start_phis(basic_block_def*)
        gcc/gimple-iterator.cc:935
0x8b42800 gsi_for_stmt(gimple*)
        gcc/gimple-iterator.cc:620
0x9121a03 insert_debug_temp_for_var_def(gimple_stmt_iterator*, tree_node*)
        gcc/tree-ssa.cc:471
0x9121f2e insert_debug_temps_for_defs(gimple_stmt_iterator*)
        gcc/tree-ssa.cc:506
0x8b42690 gsi_remove(gimple_stmt_iterator*, bool)
        gcc/gimple-iterator.cc:567
0x8ffe08b execute
        gcc/tree-ssa-dse.cc:1685

$ gcc/xg++ -Bgcc -v
Reading specs from ./gcc/specs
COLLECT_GCC=./gcc/xg++
COLLECT_LTO_WRAPPER=./gcc/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231031 (experimental) (GCC)
Comment 1 Andrew Pinski 2023-10-31 19:46:48 UTC
Dup.

*** This bug has been marked as a duplicate of bug 112320 ***