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

            Bug ID: 110298
           Summary: ICE at -Os on x86_64-linux-gnu
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shaohua.li at inf dot ethz.ch
  Target Milestone: ---

ICE at -Os.

$ cat a.c
int a, b, c, d, e;
int f() {
  c = 0;
  for (; c >= 0; c--) {
    d = 0;
    for (; d <= 0; d++) {
      e = 0;
      for (; d + c + e >= 0; e--)
        ;
      a = 1;
      b = 0;
      for (; a; ++b)
        a *= 2;
      for (; b + d >= 0;)
        return 0;
    }
  }
}
int main() {}
$
$ gcc-tk -Os a.c
during GIMPLE pass: cunroll
a.c: In function ‘f’:
a.c:2:5: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in tree_nop_conversion_p, at tree.cc:11961
    2 | int f() {
      |     ^
0x20cb70e internal_error(char const*, ...)
        ???:0
0x87f9b6 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0x16e265d generic_simplify_386(unsigned int, tree_node*, tree_node*,
tree_node*, tree_node**, tree_code)
        ???:0
0x16b8bc8 generic_simplify_GE_EXPR(unsigned int, tree_code, tree_node*,
tree_node*, tree_node*)
        ???:0
0xca5f45 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ???:0
0xcc0dc4 fold(tree_node*)
        ???:0
0x1209be8 simplify_replace_tree(tree_node*, tree_node*, tree_node*, tree_node*
(*)(tree_node*, void*), void*, bool)
        ???:0
0x120abcb substitute_in_loop_info(loop*, tree_node*, tree_node*)
        ???:0
0x10c6dc5 replace_uses_by(tree_node*, tree_node*)
        ???:0
0xb485d3 merge_blocks(basic_block_def*, basic_block_def*)
        ???:0
0x10d9784 cleanup_tree_cfg(unsigned int)
        ???: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-tk -v
Using built-in specs.
COLLECT_GCC=gcc-tk
COLLECT_LTO_WRAPPER=/zdata/shaoli/compilers/ccbuilder-compilers/gcc-27612ce352921d74086102d9ad4d3e011923f837/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++
--prefix=/zdata/shaoli/compilers/ccbuilder-compilers/gcc-27612ce352921d74086102d9ad4d3e011923f837
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230616 (experimental) (GCC)
$

Reply via email to