Add missing check to SETCC optimization.

PR17338.