>> No; compilation units have nothing to do with it, GCC can optimise
I have some patches to use -combine -fwhole-program for Linux.
Highly experimental, you need a patched bleeding edge toolchain.
If there's interest I'll clean it up and put it online.
David Woodhouse had some similar patches about a year ago.
Or the most common thing: if neither the address of the translation-
unit local variable nor the address of any function writing to that
variable can "escape" from that translation unit, nothing outside
the translation unit can write to the variable.
Heh, only about the threads it creates itself (not relevant to
the kernel, for sure :-) )
Segher
-