This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setting up stack frame, regression (gcc 4.1.0) ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]