Magician:
Two code snaps should be identical, could be compliler optimize "while" out, as there is nothing usefull in it. Checck in assembly, if there is any difference.
If PIND is properly declared volatile, the compiler should not optimize the while out. If PIND is not declared volatile, then yes the compiler likely will optimize away the while.