You can say that about any code at all, so no optimising would ever be possible. The program running faster is a side effect after all.
No, that code has no side effects. The implementation is free to produce whatever side effects it wants or needs as part of execution, but that is absolutely none of the compiler's business.