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

            Bug ID: 84132
           Summary: tree-data-ref.c:3938: poor coding ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C++ source code:

struct g {
  char b;
  unsigned char *d[];
} e;
unsigned char f;
void i() {
  for (int h;; h++) {
    unsigned a = h;
    for (int c = 0; c < 256; c += 6)
      for (int h = c; h < c + 6; h++)
        e.d[h + a] = &f;
  }
}

with recent versions of trunk g++ and compiler flag -O3, I get

during GIMPLE pass: unrolljam
bug416-min.cc: In function ‘void i()’:
bug416-min.cc:6:6: internal compiler error: Illegal instruction
 void i() {
      ^
0x10e68bf crash_signal
    ../../trunk/gcc/toplev.c:325
0x7da22f gcd_of_steps_may_divide_p
    ../../trunk/gcc/tree-data-ref.c:3938
0x7da22f analyze_miv_subscript
    ../../trunk/gcc/tree-data-ref.c:3982

The source code at trunk/gcc/tree-data-ref.c:3938 is

 return val % cd == 0;

The problem seems to exist between revision 257009 and 257076.

Reply via email to