std::pow implementation

Steven Bosscher
Wed Jul 30 16:24:00 GMT 2003

Op wo 30-07-2003, om 17:52 schreef Richard Guenther:
> > It is no surprise that inlinig with no proper constant propagation and
> > dead code elimination does not produce better code.
> I think this statement is way too harsh, as cprop and dce are quite good
> with gcc - apart from some special cases such as your std::pow(T, int)
> implementation (for which we need to blame the loop unroller, not cprop
> or dce).

True, but it happens too late for languages that build functions as
trees and inline trees.  One of the reasons why the inline limits have
been fairly low, was that expand would consume huge amounts of time, and
I've seen PRs for functions that blew up to as much as 1GB.

BTW Another reason was quadratic behavior in other parts of the compiler
(was it the scheduler???).


More information about the Gcc mailing list