https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113551
--- Comment #11 from Yuxuan Shui <yshuiv7 at gmail dot com> --- reduced it a bit: void bug(struct obj **root, struct obj *dso) { if (&dso->i) { while (1) { struct obj *this = *root; if (dso == (void *)0) // should return here return; if (dso == this) return; // shouldn't reach here assert_not_null(dso); } } }