------- Comment #2 from dberlin at gcc dot gnu dot org  2008-11-21 16:55 -------
(In reply to comment #0)
> For this function:
> int test (int a, int b, int c, int g)
> {
>   int d, e;
>   if (a)
>     d = b * c;
>   else
>     d = b - c;
>   e = b * c + g;
>   return d + e;
> }
> 
> the multiply expression is moved to both branches of the "if", it would be
> better to move it before the "if".  Intel's compiler does that.
> 

Moving it before the if is a code size optimization that also happens to extend
the lifetime of the multiply.
So "better" is a relative term.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38204

Reply via email to