When optimizing sql at intelligence level 5, I get an "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." error.
Optimize at an intelligence level lower than 5.
Waiting for fix to be released in a future version of SQL Optimizer.