This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Was: Re: Loop optimizer misses simple optimisation?


> int a, b, c, d;
> ...
>   c = b / c;
>   d = b % c;
>   
> becomes:
> 
>   c = a / b;
>   d = a - c * b;  

This would have to depend on the cost of the modulo operation - and if b
is constant or can be made constant by constant-propagation, this also
ight make a difference to the cost.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]