This is the mail archive of the gcc-help@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: question about allocating local variable


Hi Prawit,

>And I will be appreciate if you could tell me why it gonna be that way.

I presume it is due to allocated space for register backing stores.

Granted, in lovingly hand-crafted assembly, you may dispense with over reserved stack space through meticulous care.

In this situation, GCC seems to over-allocate the stack beyond what it strictly needs (moreso than just alignment). Considering that the small routine I wrote is a leaf-node (doesn't call any other subroutines).

>gcc 2.96 on x86

There is no "GCC 2.96" -- there's a Red Hat 2.96, which is a maverick / rogue release. Red Hat 2.96 is not supported in this forum; it may be supported by Red Hat.

That being said, GCC 3.3.1 on Cygwin / WinNT has the same behavior.

You may want to try the current releases of GCC, either GCC 3.3.4 or GCC 3.4.0.

>And asm code are the same no matter what you gonna optimized or not.

Okay, I've confirmed that with -O0 and -O3 on my platform.

--Eljay


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