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

            Bug ID: 87967
           Summary: ice in slpeel_duplicate_current_defs_from_edges
           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++ code:

void h();
template <typename b> struct k { using d = b; };
template <typename b, template <typename> class> using e = k<b>;
template <typename b, template <typename> class f>
using g = typename e<b, f>::d;
struct l {
  template <typename i> using ab = typename i::j;
};
struct n : l {
  using j = g<char *, ab>;
};
class o {
public:
  long r();
};
char m;
char s() {
  if (m)
    return '0';
  return 'A';
}
class t {
public:
  typedef char *ad;
  ad m_fn2();
};
void fn3() {
  char *a;
  t b;
  bool p = false;
  while (*a) {
    h();
    o c;
    if (*a)
      a++;
    if (c.r()) {
      n::j q;
      for (t::ad d = b.m_fn2(), e; d != e; d++) {
        char f = *q;
        *d = f + s();
      }
      p = true;
    }
  }
  if (p)
    throw;
}

compiled with recent gcc trunk and compiler flag -O3, does this:

during GIMPLE pass: vect
bug476.cc: In function ‘void fn3()’:
bug476.cc:27:6: internal compiler error: Segmentation fault
   27 | void fn3() {
      |      ^~~
0xfa4967 crash_signal
        ../../trunk/gcc/toplev.c:325
0x12185e4 contains_struct_check(tree_node*, tree_node_structure_enum, char
const
*, int, char const*)
        ../../trunk/gcc/tree.h:3267
0x12185e4 slpeel_duplicate_current_defs_from_edges
        ../../trunk/gcc/tree-vect-loop-manip.c:985

The bug seems to have appeared between revision 265790 and 265846.

Reply via email to