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: GCC/assembly question


On Thu, Jun 19, 2003 at 12:15:46PM -0400, Diego Figueroa wrote:
> Is there a reasoning behind this? I don't understand if those things are
> intentional? Even when the code is optimized I still get the
> 'subl $8, %esp' instruction that I can't figure out.

It comes from the following in gcc/config/i386/i386.h:

/* As of July 2001, many runtimes to not align the stack properly when
   entering main.  This causes expand_main_function to forcibly align
   the stack, which results in aligned frames for functions called from
   main, though it does nothing for the alignment of main itself.  */
#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN \
  (ix86_preferred_stack_boundary > STACK_BOUNDARY && !TARGET_64BIT)

If you had picked some other function than "main" and used -O2
-fomit-frame-pointer, you wouldn't see any additional code.

-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org


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