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

--- Comment #2 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another instance that fails also at -O1 with -fcode-hoisting.

Compiler Explorer: https://godbolt.org/z/svqKzoPqT

Note:
- fails: trunk
- works: 15.2 and earlier
- -O1 with -fcode-hoisting, and -O{s,2,3}

[599] % gcctk -O1 -fcode-hoisting -c small.c 
during GIMPLE pass: pre
small.c: In function ā€˜e’:
small.c:2:6: internal compiler error: in compute_antic, at tree-ssa-pre.cc:2449
    2 | void e(int *f) {
      |      ^
0x257227b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:786
0xa0a1c6 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1803
0x8ec794 compute_antic
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:2449
0x8ec794 execute
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:4476
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.
[600] % gcctk -O3 -c small.c
during GIMPLE pass: pre
small.c: In function ā€˜e’:
small.c:2:6: internal compiler error: in compute_antic, at tree-ssa-pre.cc:2449
    2 | void e(int *f) {
      |      ^
0x257227b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:786
0xa0a1c6 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1803
0x8ec794 compute_antic
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:2449
0x8ec794 execute
        ../../gcc-trunk/gcc/tree-ssa-pre.cc:4476
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.
[601] % cat small.c
int a, b, c;
void e(int *f) {
  int d = 0;
  if (f)
    goto g;
  goto h;
i:
  d = 1 + f[0];
j:
  if (c)
    goto h;
k:
  if (b)
    goto i;
  if (a)
    goto j;
g:
  if (d + f[0])
    goto k;
h:
  int l[] = {f[0]};
  if (a)
    e(l);
}

Reply via email to