On Mon, 2006-12-04 at 15:47 +0200, Kimmo Fredriksson wrote: > Hi, > > Consider this (simplified) test case: > > int bar (int a) > { > int b; > memcpy (&b, &a, sizeof (int)); > return b; > } > The local variable is optimized away, so what's the point adjusting esp?
This testcase has already been fixed in 4.2.0. There are other related memcpy cases which have not been fixed yet though. The reason why the pointer adjust is happening is that the local variable is not really optimized away until after it was already placed on the stack. Thanks, Andrew Pinski