But still if a compiler was to optimise x >> 1000, it should set x=0, not leave x unchanged.
In theory, the C compiler should generate a code to produce calculations in run time. It
may do the calculation at the compile time, but this would be an optimization. When applying such optimization, the compiler
must produce the same result as you would see without the optimization. So, on most processors you should expect x >> 1000 be the same as x >> 8.
However, when you write x >> 1000 it is a bug, because the operation is defined for right size of up to 31. So "x >> 1000" is undefined and therefore a bug, same as "x/0". You just don't do it. If you use it for some sort of special purpose, do it at your own risk.
On the other hand, even when allowed by the specification, the compiler shouldn't turn openly hostile. Compiler is a tool, not a cerberus for the C standard. Imagine, if you pressed a wrong button on a hand drill and it would jump and drill a hole in your eye to punish you for pressing a wrong button. Who would've used such a tool?