This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/86871] ICE: gimple check: expected gimple_assign(error_mark), have gimple_call(trunc_mod_expr) in gimple_assign_lhs, at gimple.h:2462


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

--- Comment #1 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Managed to get rid of templates. Looks like use of uninitialized 'i' is somehow
the culprit:

int *f;
struct g {
  g() {
    f = new int;
    aj = f;
  }
  int &operator[](int h) { return *(aj + h); }
  int *aj;
};
void j() {
  g b;
  g c;
  for (int i; i; i++) {
    int d = 0;
    for (int e = -1; e <= 1; e++) {
      int a = i + e;
      if (a)
        d = b[a];
    }
    c[i] = d;
  }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]