This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Was: Re: Loop optimizer misses simple optimisation?
- To: jvickers at acorn dot com (John Vickers)
- Subject: Re: Was: Re: Loop optimizer misses simple optimisation?
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Wed, 6 May 1998 18:29:29 +0100 (BST)
- Cc: egcs at cygnus dot com
> 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.