I was very surprised to discover the following about avr-gcc:
when I put something like:
y = x * (1600 / 100);
I expected the compiler to reduce it to:
y = x * 16;
But it seems like it actually keeps both the multiplication and the division, when it is clearly not needed.
In the case where 1600 is replaced by a #defined variable, this becomes a serious pain in the ass since performance suffers a lot.
Is there some options I can put to tell the compiler to precompute all values?