Please report your findings in the bugtracker. Also, if you can test if FPC trunk behaves similarly.
In trunk the internal implementation of case has been changed. trunk behaves ok. Tested windows and linux-arm r37005.
What I don't understand is that it worked w/o optimization: case had a shortint size limit -32768-+32767. It is now int32.
Rangechecks and overflowchecks would have caught that, without rangechecks it silently overflows and starts again indefiinitely..
See my previous answer. You will still have to manage your stacksize if this is inside a local routine...