Move optimization flag selection out of cc wrapper