This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
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.