This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: dewar at gnat dot com (Robert Dewar)
- To: gdr at integrable-solutions dot net, jbuck at synopsys dot com
- Cc: aoliva at redhat dot com, bernds at redhat dot com, dewar at gnat dot com,gcc at gcc dot gnu dot org, rguenth at tat dot physik dot uni-tuebingen dot de,s dot bosscher at student dot tudelft dot nl
- Date: Mon, 4 Aug 2003 14:17:17 -0400 (EDT)
- Subject: Re: std::pow implementation
> I won't insist on the "as-if" rule: the longstanding promise in the GCC
> manual that "an inlined function is as fast as a macro" will do for me
> as a spec. If you can achieve that without actually doing the inlining,
> go for it.
That's a problematic spec, it is not at all clear that you cam make
this guarantee. In our experience, you often get some junk from the
inlining process in gcc that is eliminated if you do macro expansion.
In fact we recently implemented front end inlining in GNAT (the -gnatN
switch) which gives something closer to C macro behavior, and we often
find that we get better code.