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

            Bug ID: 69452
           Summary: gcc ICE at -O3 on x86_64-linux-gnu in with “verify_ssa
                    failed”
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following valid code causes an ICE when compiled with the current gcc trunk
at only -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. The other
optimization levels work just fine.

Unlike PR69341, it does not depend on the graphite loop transformation
infrastructure.


$ 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/6.0.0/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 6.0.0 20160123 (experimental) [trunk revision 232764] (GCC)



$ gcc-trunk -O3 abc.c
abc.c: In function 'fn2':
abc.c:9:6: error: definition in block 42 follows the use
 void fn2() {
      ^~~

for SSA_NAME: _93 in statement:
c_lsm.20_116 = r_75 != 0 ? _93 : _71;
abc.c:9:6: internal compiler error: verify_ssa failed
0xd55112 verify_ssa(bool, bool)
        ../../gcc/gcc/tree-ssa.c:1039
0xa9037d execute_function_todo
        ../../gcc/gcc/passes.c:1965
0xa90bfb execute_todo
        ../../gcc/gcc/passes.c:2010
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


————————————
$ cat abc.c
short a, f, h;
struct S0 {
  int f0;
} b;
char c, d, e, j, k;
int g;
char fn1(char p1, int p2) { return 7 >> p2 ? p1 : p2; }
void fn2() {
  int l, m, n;
  struct S0 o = {0};
  for (;;) {
    int p = 1, r = e;
    unsigned q = 6;
    l = r == 0 ? q : q % r;
    n = l;
    c = f;
    k = fn1(p, n ^ e);
    char s = k;
    j = s / 6;
    if (j) {
      int t = d, u = m = d ? t : t / d;
      h = a || u;
      b.f0 = h;
      for (; d;)
        ;
    } else {
      b = o;
      if (d != g)
        for (;;)
          ;
    }
  }
}
int main() {}

Reply via email to