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

            Bug ID: 116812
           Summary: ICE on valid code at -O2 with "-fno-tree-dce
                    -fno-tree-dse" on x86_64-linux-gnu: verify_flow_info
                    failed
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

[517] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240922 (experimental) (GCC) 
[518] % 
[518] % gcctk -O2 small.c; ./a.out
[519] % 
[519] % gcctk -O2 -fno-tree-dce -fno-tree-dse small.c
small.c: In function ‘main’:
small.c:3:5: error: control flow in the middle of basic block 9
    3 | int main() {
      |     ^~~~
small.c:3:5: error: true/false edge after a non-GIMPLE_COND in bb 9
small.c:3:5: error: true/false edge after a non-GIMPLE_COND in bb 9
during GIMPLE pass: slp
small.c:3:5: internal compiler error: verify_flow_info failed
0x25b5f05 internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:517
0xc2f7bf verify_flow_info()
        ../../gcc-trunk/gcc/cfghooks.cc:287
0x1074b97 execute_function_todo
        ../../gcc-trunk/gcc/passes.cc:2113
0x107550e execute_todo
        ../../gcc-trunk/gcc/passes.cc:2155
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.
[520] % 
[520] % cat small.c
int a, b, c, d, e, f[2], g, h;
int k(int j) { return 2 >> a ? 2 >> a : a; }
int main() {
  int i;
  for (; g; g = k(d = 0))
    ;
  if (a)
    b && h;
  for (e = 0; e < 2; e++)
    c = d & 1 ? d : 0;
  for (i = 0; i < 2; i++)
    f[i] = 0;
  return 0;
}

Reply via email to