Anders Kaseorg did some excellent research on this and filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61964 against gcc. That bug report also contains a better test case (circ.c doesn't manifest the bug in gcc 4.8.2, but does manifest the bug in mpool.c; the test case in the gcc bug report does manifest the bug in gcc 4.8.2.)