SimplifyCFG: turn recursive GatherConstantCompares into iterative

A long sequence of || or && could lead to a stack explosion.