I have worked on projects for embedded systems in the past where we have rearranged the order of declaration of stack variables to decrease the size of the resulting executa
The compiler is even free to remove the variable from the stack and make it register only if analysis shows that the address of the variable is never taken/used.