Fix Issue 5908 - Optimizer generates wrong value with divide-by-zero.

Reinstate optimizer error for integer division by zero
Merge pull request #3810 from yebblies/issue5908

Issue 5908 - Optimizer generates wrong value with divide-by-zero.