App will crash when upgrade for xcode9 to 10.1

After upgrade my xcode from 9.0 to 10.1(iOS SDK12.1), my app will crash when optimization level of xcode set to Fastest, smallest[-0s].If I turn off the optimization option, the program will work properly. I think the reason is the new version llvm. so i want to recompile my program with iOS sdk12.1 and xcode9, but the program cann't be compiled, there are so many errors. so how to solve this problem.