std::pow implementation

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


Joe Buck <jbuck@synopsys.com> writes:

| Alexandre Oliva wrote:
| > | Consider a very complex function
| > | that takes a boolean argument, used to enable or disable most of the
| > | complexity in the function.  If the caller passes a false boolean
| > | argument, the function would simplify to pretty much nothing.
| 
| On Wed, Jul 30, 2003 at 06:58:24AM +0200, Gabriel Dos Reis wrote:
| > This is not a convincing example.
| 
| Ouch.  It is convincing to me!
| 
| > | Therefore claiming that the context of use shouldn't play any role in
| > | deciding whether a function should be inlined is absurd.
| > 
| > No, what is absurb is the imaginary scenario you describ above.
| 
| Gaby, the scenario Alex describes is COMMON.  Constant propagation
| frequently causes lots of code to be thrown away, and any automatic
| inlining decision that doesn't take this effect into account is broken.

I agree with your last sentence, but the context in which Alexandre
made his example does not make it a convincing one.  Which is what I
(attempted to) phrased above.

-- Gaby



More information about the Gcc mailing list