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]

Re: ACCUMULATE_OUTGOING_ARGS and the i386



  In message <199810192206.SAA25635@contents-vnder-pressvre.mit.edu>you write:
  > The Metaware compiler does the equivalent optimization for some x86
  > targets so it is probably reasonably safe and good.
  > 
  > On most x86 targets, ACCUMULATE_OUTGOING_ARGS generates faster, larger
  > code.  A 1 byte push becomes a 5+ byte move.
  > 
  > The code size expansion can be significant, so I think we should first
  > change gcc to test the value ACCUMULATE_OUTGOING_ARGS at runtime.
  > On x86 it should be off for (at least) target=386 or flag_optimize_size.
I can't think of any reason off the top of my head why this would be all that
difficult.  ACCUMULATE_OUTGOING_ARGS does not change the calling conventions
in any incompatible manner that I'm aware of.

I think this is an excellent idea.  It also provides much of the framework
necessary to test other architectures where this may be useful (like the
m68k, h8 and others I'm sure).

Who wants to take a crack at it?

I'd recommend something like this in a common header file

#ifndef ACCUMULATE_OUTGOING_ARGS
#define ACCUMULATE_OUTGOING_ARGS 0
#endif

Then change all the #ifdefs elsewhere to look like

  if (ACCUMULATE_OUTGOING_ARGS)
   [ ... ]
  else
   [ ... ]


Ie, let's just give it a default value and not mess with all the #ifdefs.



Once the machine independent code is converted, converting the x86
backend ought to be a snap.  A new flag and include
current_function_outgoing_args_size when computing the frame size
(and possibly elimination offsets depending on the stack layout).


jeff


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