>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)srce.hr> writes:
> Conceptually, I don't see any difference. Sufficiently good
> compilers should obsolete use of register and inline.
Hrvoje> There is a big difference, and I will repeat it:
Hrvoje> With -O3, you give the compiler free hands to do what it chooses with
Hrvoje> inlining the functions. The compiler may be Very Smart, but it cannot
Hrvoje> possibly know all the XEmacs context.
Neither can the XEmacs developers. Programmers are notoriously poor
at judging performance issues in the source code they maintain.
The particular case of digit_to_number is sad. Inlining the function
always saves code size AND execution time, so gcc should inline it with -O2.
Hrvoje> On the other hand, with -O2 + inline declarations, you decide against
Hrvoje> inlining the functions, except when you say so.
> I encourage you to go ahead and experiment with changing
functions
> which are currently `static' to `static inline'. See what `inline'
> is defined to in config.h with your compiler.
Hrvoje> I use Gcc, so `inline' does not have a preprocessor definition.
Correct.
Project: You could write a program to determine all static functions
in XEmacs that are called only once. Then add inline to their
function definitions. As an added help for the stupid compiler, make
sure the definitions of these functions are located prior to their use
in the source code.
Martin