ensure the compiler does not move around thread-register-based reads

if gcc decided to move this across a conditional that checks validity
of the thread register, an invalid thread-register-based read could be
performed and raise sigsegv.
2 files changed