Fix undefined behavior in the Mips backend.