On Fri, 2007-11-02 at 22:35 -0700, Ian Lance Taylor wrote: > skaller <[EMAIL PROTECTED]> writes: > > > Neko, for example, uses a register. AFAIK MLton does the > > same kind of thing. If gcc team thinks ANY register is free > > to steal they'd be wrong -- that doesn't mean it shouldn't > > be used, just that it definitely is NOT free. > > To be clear, it is not the gcc team which is stealing the register. > As I said earlier, TLS (i.e., __thread) was defined by Sun. They > defined the implementation for i386 and SPARC. Other organizations > have carried it forward to other processors. Here is the Sun > documentation: > http://docs.sun.com/app/docs/doc/817-1984/6mhm7pl2a > TLS is implemented via a combination of the compiler, the system > library, and the kernel.
Thanks! So the use is defined by a protocol which gcc is following. > As I said before, the register is only stolen for code which actually > uses TLS. So scanning that document, for x86_64, fs is used in startup code, presumably if, and only if, there is a linker section containing __thread variables? -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net