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

--- Comment #3 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another test without using "-fno-tree-ccp -fno-tree-dce -fno-tree-vrp":

[700] % 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/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220226 (experimental) [master r12-7395-gafeaaf4b352] (GCC)
[701] %
[701] % gcctk -O2 small.c
during GIMPLE pass: pre
small.c: In function ‘o’:
small.c:3:6: internal compiler error: in find_or_generate_expression, at
tree-ssa-pre.cc:2795
    3 | void o() {
      |      ^
0x1005c10 find_or_generate_expression
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:2795
0x1005132 create_expression_by_pieces
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:2951
0x10095b1 insert_into_preds_of_block
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:3159
0x100b134 do_pre_regular_insertion
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:3416
0x100b134 insert
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:3809
0x100b134 execute
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:4433
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.
[702] %
[702] % cat small.c
int printf(const char *, ...);
int a, b, c = 2, d, e, *f, g;
void o() {
  unsigned h = 1;
  int j = -1, k, l = 1, m = 2, i;
  while (c < 2)
    ;
L1:
  k = h;
  h = -1;
  if (k < 2 && !c) {
    printf("%d", k);
    goto L1;
  }
  if (!j)
    l = printf("0");
  if (g)
    k = 0;
  if (a && k)
    goto L2;
  while (f) {
    m = a;
    d = i;
    i = e;
    f = &j;
  L2:
    if (d == l && !m)
      l = b;
  }
  unsigned *n[1] = {&h};
}
int main() {
  o();
  return 0;
}


------


>From Compiler Explorer: https://godbolt.org/z/b9z9e71oh

Reply via email to