This is the mail archive of the gcc-bugs@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]

Varargs and GNU CC for PPC860


To whom it may concern:

I have been directed to your mailbox by the GNU ToolKit User's Guide documentation produced by WindRiver Systems.  If I am in error by sending you this message, please forgive me.

I am trying to compile C code to run on a PPC860 platform.  The GNU compiler, when compiling a function call, will put all of the arguments into registers and call the function.  Now, I was wondering if this feature could be turned off, such that the parameters are pushed onto the stack instead of being placed into registers.

Without going into too much detail, my code contains a function that takes a variable number of arguments and essentially does the following:

void func (int arg1, ...)
{
  int *argptr;
  int arg1, arg2, arg3;

  argptr = &arg1;
  arg1 = *argptr++;
  arg2 = *argptr++;
  arg3 = *argptr++;
  /* AND SO FORTH */
}

My printf function uses this method to access all of the parameters passed to the function.

I desire either of two things:  1) I would like to be able to tell the GNU PPC860 compiler to pass arguments on the stack, or  2) I would like to know how I could implement a function with a variable number of parameters without writing assembly code.  There does not seem to be any documentation on how to accomplish this in the manual supplied by WindRiver Systems.

Thank you for your time,

*************************************
Jay Hotvedt, Software Engineer
ADC Telecommunications, Inc.
voice: 805-384-4088
fax: 805-484-9347
email: jay_hotvedt@adc.com
*************************************


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