add gcc version check for optimization option