On 04/05/2009 05:20 PM, marian Szczepkowski wrote:
Sure, this is what I have as a test as I wanted to look at function call
overhead, and the compiler used is "powerpc-eabi-gcc (eCosCentric GNU
tools 4.3.2-sw) 4.3.2", after a bunch of messing around I ended up using
this to invike the compiler, not that it seemed to make any difference,
"powerpc-eabi-gcc -S println.c -finline-functions -fbtr-bb-exclusive
-fdefer-pop -fwhole-progr". I lay no claim to brilliance with compiler
options I was primarily just trying to see if the options had any
effect.
I tried this on my box.
A few notes:
o The compiler barfed until I swapped the #define and the #include
o The -finline-functions switch has no effect until one specifies the
-O3 switch. From TFM:
`-finline-functions'
Integrate all simple functions into their callers. The compiler
heuristically decides which functions are simple enough to be worth
integrating in this way.
If all calls to a given function are integrated, and the function
is declared `static', then the function is normally not output as
assembler code in its own right.
Enabled at level `-O3'.
#define unsigned int size_t
#include<stdio.h>
char *pstr ="42";
void myCall(char *cptr)
{
sprintf(cptr,"Hello baby %f %u", atoi(pstr),atof(pstr));
}
void main(int argc, char **argv)
{
char cptr[32];
myCall(&cptr[0]);
printf("%s\n",cptr);
}
/* END */