If you don't give any optimization switch, I believe gcc does -O1, which is "midle and gentle optimization".
And under these conditions, it will definitely replace divide by shift when possible [I just tried it].
If you write a little piece of code to test it, use -S to get gcc to give you assembler output, and you should see what it does.
--
Mats

