No, but they may optimize out assigning to the reference at all, since assigning to it requires dereferencing a provably null pointer, which means that any future code is effectively meaningless.
They wouldn't, but they could very well come to a different sane result on a particular architecture than they implementation/architecture you're on.
And that would be perfectly compiler-legal, and your code would have one free bug.
Although no sane implementation would do this.