Re: kernel stack problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is wrong. Although the scope is at _block_ level, all variables are
allocated on the stack at _function_ level. So, when entering func() all
variables within it, including x and y, are allocated.

But this doesn't make sense. Why would the compiler not immediately optimize both variables into the same allocation? It seems obvious to me that the amount of space pushed onto the stack when the function is entered should be the maximum space needed by any combination of local variables in-scope at any time. GCC wouldn't be that stupid, would it?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux