https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78576
--- Comment #10 from Bill Schmidt <wschmidt at gcc dot gnu.org> --- OK, that accounts for it. That would be a glibc problem. Building this code with GCC trunk on Ubuntu 14.04 with glibc 2.19, the program produces 27 as expected.