Does the compiler perform any optimization on this? Like check if the global variable is even used in the function?