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

            Bug ID: 84427
           Summary: gcc ICE at -O3 on x86_64-linux-gnu in compute_antic,
                    at tree-ssa-pre.c:2356
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

Level "-O2" works fine.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 8.0.1 20180216 (experimental) [trunk revision 257735] (GCC) 



$ gcc-trunk -O3 -c abc.c
abc.c: In function ‘fn1’:
abc.c:5:14: warning: implicit declaration of function ‘fn2’; did you mean
‘fn1’? [-Wimplicit-function-declaration]
 void fn1() { fn2(e, a); }
              ^~~
              fn1
during GIMPLE pass: pre
abc.c:5:6: internal compiler error: in compute_antic, at tree-ssa-pre.c:2356
 void fn1() { fn2(e, a); }
      ^~~
0x6cc6ff compute_antic
        ../../gcc/gcc/tree-ssa-pre.c:2356
0x6cc6ff execute
        ../../gcc/gcc/tree-ssa-pre.c:4114
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ cat abc.c
short a, d, e;
unsigned char b;
int c, f;
char g, h;
void fn1() { fn2(e, a); }
int fn2(int p1, int p2) {
l1:
  b = a;
  for (; h; h--)
    if (p1)
      g = p2 * c;
    else {
      c = d;
      if (f)
        goto l1;
    }
}

Reply via email to