https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99621
--- Comment #21 from Martin Liška <marxin at gcc dot gnu.org> --- All right, I think it's a well-known problem called X87 FP unit. The test-case is fixed with: $ gcc pr99621-3.c -O2 -m32 && ./a.out len 5167, expected bad $ gcc pr99621-3.c -O2 -m32 -ffloat-store && ./a.out len 4287, good $ gcc pr99621-3.c -O2 -m32 -mfpmath=sse && ./a.out len 4287, good