https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88578
--- Comment #1 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- It turns out, that the order of the static objects is reversed by -O2, so each test clobbers the previous one after the assertion is run. If the test case is changed to run the functions twice the second run hits an assertion.