There seems to be a problem with switch and more than 6 cases. The CPU will sometimes jump into the wilderness. It's not that simple though.
I am testing a program with two tasks. One has the big switch statement and the other does not. If I build with only the one with the switch, I get the problem. If I add the other task, there is no problem. Weird.
I had this problem with Studio 6.2.1153 so I installed SP1 and I still have the problem. My current version of avr-gcc is 4.6.2. GNU toolchain 3.4.0_663.
I can get around it easily enough. I normally run with both tasks anyway. I removed the other task to do some testing and got blindsided with this thing. Another workaround of course, is to replace the switch with a series of if statements.
EDIT: I should have said I'm programming an Xmega.