Make x volatile to prevent infinite loop caused by overaggressive optimization.

This fixes issue #257.
Merge pull request #437 from blipvert/fixes/9

Make x volatile to prevent infinite loop caused by overaggressive optimization