Fwd: GCC Optimization for expressions

Ian Lance Taylor iant@google.com
Mon Dec 1 21:04:00 GMT 2008


"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.

Ian



More information about the Gcc-help mailing list