Possible Duplicate:
how does an optimizing c++ compiler reuse stack slot of a function?
do c++ compilers have their ways to determine the time at which, life-time of each local variable in a function ends so that they optimize using stack memory, or they simply take it equal to life-time of the function execution ?