http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46131
--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> 2010-10-22 14:51:59 UTC --- I don't see anything wrong in the assembler code for the test case. I think you'll need to debug the libgcc routines to see what's going wrong in between there and the system thread library. Of course this test passes at -O3 because in that case we inline the function and simplify everything away entirely.