Fwd: GCC Optimization for expressions
Vincent Lefevre
vincent+gcc@vinc17.org
Tue Dec 2 14:17:00 GMT 2008
On 2008-12-01 13:02:21 -0800, Ian Lance Taylor wrote:
> "Nirav Shah" <nirav4ever4u@gmail.com> writes:
>
> > No expression is evaluated in loop nor any particular intermediate
> > result is used more than once. Given this, can I get benefit in terms
> > of lesser clock cycle to execute the computation if done in a single
> > statement as compared to done over multiple statements with local
> > variables?
>
> No. When optimizing, the compiler converts your program into an
> internal representation in SSA form. The number of local variables
> used in the original program is irrelevant to the generated code.
This may be what GCC currently does, but this is a bug when extended
precision is used to evaluate an expression.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
More information about the Gcc-help
mailing list