Is it possible to mix (link) gcc 4.5 *.o files and gcc 4.8 *.o files? If so, you can bisect offending code. Luckily most of syncronization operations are not inlined. There are also some unrolled locking codes which directly use membar(9); e.g. file descriptor code, which is IMO highly suspicious.