help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About g++ optimization


From: Rolf Magnus
Subject: Re: About g++ optimization
Date: Fri, 07 Apr 2006 11:56:33 +0200

rmansfield@gmail.com wrote:

> Peng,
> 
> The space between the ++ and i is fine. Some find ++i more readable,
> that is all.
> 
> It is difficult to optimize away the repeated f(n) calls because f()
> could have side effects and there is no guarantee it will always return
> a constant. If f() always returns a constant, this could potentially be
> optimized by interprocedural constant propagation(IPCP)

GCC also offers the __attribute__((pure)) for such functions.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]