std::pow implementation

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Jul 30 16:01:00 GMT 2003


Steven Bosscher <s.bosscher@student.tudelft.nl> writes:

| Op wo 30-07-2003, om 17:28 schreef Scott Robert Ladd:
| > Alexandre Oliva wrote:
| > > Therefore, inline the way you describe it, is useful only for 
| > > functions that are *always* profitable to inline.  Any function that 
| > > might or might not be profitable to inline should not be declared 
| > > inline, and the compiler would never inline it.  This sounds silly to
| > >  me.  Why not let the user tell the compiler `hey, look, this
| > > function is probably worth trying to inline', but letting the
| > > compiler decide whether it's actually profitable or not, depending
| > > not only on the context, but also on machine-dependent features?
| > 
| > IMNSHO, the keyword "inline" means precisely what it says: to inline the
| > code for a given function, if possible.
| 
| Richard Guenther's experience with this meaning for "inline" are not
| that positive: http://gcc.gnu.org/ml/gcc/2003-07/msg02140.html.

It is no surprise that inlinig with no proper constant propagation and
dead code elimination does not produce better code.

In effect, if you have a close look at the pattern of usage of C++,
you'll notice that after inlining, there are lots of opportunities for
the compiler to remove junks.  KCC understood that.

| And then he's the guy who always wants more inlining :-p

He does not want (rightly) "just" wants more inlining.

It helps just not to focuse on the medium, the message is more
important. 

-- Gaby



More information about the Gcc mailing list