Thomas W. Carley wrote:
If you read the gcc docs carefully you will see that function inlining is
only with -O3. You can also turn it on by itself with -finline-functions.
See
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Optimize-Options.html#Optimize-O
ptions for more info.
yep, and also
http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Inline.html#Inline
which also says:
"""
When an inline function is not static, then the compiler must assume
that there may be calls from other source files; since a global symbol
can be defined only once in any program, the function must not be
defined in the other source files, so the calls therein cannot be
integrated. Therefore, a non-static inline function is always compiled
on its own in the usual fashion.
"""
so to get the shortest code use "static inline ..." where possible
chris
-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Robert
Mitschke
Sent: Saturday, December 04, 2004 6:30 AM
To: mspgcc-users@lists.sourceforge.net
Subject: [Mspgcc-users] Inline C Functions
Hi all,
I am using the release version of mspgcc. In our project we have a lot of
very small functions (few lines)
which were created to have a good code design, and to allow newbees to
understand the code easily.
However of course these functions of a few lines each are pretty inefficient
and I tried to declare them all
inline. However the output .lst file still shows all the functions
separately and not inline.
I do use -O for optimization, but still have -g switched on while compiling.
Is there a way to get the
compiler to respect the inline declarations?
Would very much appreciate a pointer in the right direction,
Regards,
Robert