std::pow implementation

Robert Dewar dewar@gnat.com
Mon Aug 4 18:21:00 GMT 2003


> 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.



More information about the Gcc mailing list