This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gdr at integrable-solutions dot net, rguenth at tat dot physik dot uni-tuebingen dot de, Richard dot Earnshaw at arm dot com, aoliva at redhat dot com, gcc at gcc dot gnu dot org, kgardas at objectsecurity dot com
- Date: Wed, 30 Jul 2003 15:18:06 +0100
- Subject: Re: std::pow implementation
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> > The only sane possible semantics I see are:
> >
> > 1. inline declared functions are inlined always if technically possible
> > 2. the inline keyword has no effect
> > 3. inline is handled in an implementation defined manner (as stated in the
> > standard), maybe by adjusting the set of functions considered for inlining,
> > as gcc does.
>
> None of these three semantics make sense to me. The only one that makes sense
> is the one I gave before.
>
> Speed up calls to this function, by doing optimizations (most obviously by
> inlining the call) that speed up execution, even if it results in extra space
> for generated code.
If I'm compiling some code with -Ospace I really don't want that
definition. Instead, I'd want "Optimize the call overhead away if that
will result in smaller code".
Optimization is about trying to meet certain goals with a "cost metric".
What that cost metric is can vary from use to use; it's important that we
don't blind ourselves to the situations when that isn't "maximum
performance".
> (the comment here is suggestive, not normative, in standards terms, but we
> know perfectly well what it means as implementors).
Ditto.
R.