Why doesn't Arduino 1.0.1 use the latest GCC?

stimmer:
What I meant was that avr-gcc 4.3.2 and 4.7.0 behave in exactly the same way - so it isn't worth upgrading in the hope that the newer gcc will optimize the shift any better than the old one. I don't know why it doesn't use swap for a right shift, but there may be something I don't know (perhaps it was tried but caused problems) In any case it would only be useful for the fairly rare case of shifting an unsigned byte by 4 places.

It might be a bit too much to expect the compiler to know when it can use a swap - I wouldn't expect it to get x=(x>>4)|(x<<4); down to a single swap! :slight_smile:

GCC has been doing the optimization of turning that into a rotate for a long time. It depends on whether the backend maintainer has described that particular optimization in the .md file.