--- In [email protected], "John Matthews" <jm5...@...> wrote:
>
> --- In [email protected], "peternilsson42" <peternilsson42@> wrote:
> >
> > However main() is
> > optimised effectively to a no-op since the compiler
> > was able to recognise that foo(i) will indeed equal
> > bar(i) for the iterated values of i!
> 
> I'm not disputing the evidence, but I'm very surprised it can go
> that far. I wonder how many other functions (besides pow())
> it 'knows' about?

And if it's clever enough to optimise out the calls to the functions, why still 
generate the code for them? I would have thought that recognising that they're 
unused would be relatively simple.

Reply via email to