Re: Here's a simple experiment...
Indeed, compilers must be 100% deterministic, because otherwise they fundamentally could never comply with the standard for their language.
However, two different compilers - inc. versions of compiler or compiler settings - probably won't give the same result as each other as they will favour different optimisations when multiple are permitted, or use a different implementation of the appropriate standard libraries.
So if your code relies on undefined behaviour, it can and will blow up in your face the moment you update or change compiler.
For a great example of undefined behaviour: in C++, "char" is not 8 bits.
For others - illegal operations are not allowed, and thus the code path that results in an illegal operation cannot happen, thus can be optimised out of the binary. It can't happen, so why waste space?