This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "slyfox at inbox dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Aug 2018 21:50:38 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-86871-4@http.gcc.gnu.org/bugzilla/>
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;
}
}