diff -Naur Python-3.7.0-orig/Lib/distutils/cygwinccompiler.py Python-3.7.0/Lib/distutils/cygwinccompiler.py --- Python-3.7.0-orig/Lib/distutils/cygwinccompiler.py 2018-07-12 10:21:58.843219400 +0300 +++ Python-3.7.0/Lib/distutils/cygwinccompiler.py 2018-07-12 10:22:29.122872600 +0300 @@ -305,9 +305,9 @@ raise CCompilerError( 'Cygwin gcc cannot be used with --compiler=mingw32') - self.set_executables(compiler='gcc -O -Wall', - compiler_so='gcc -mdll -O -Wall', - compiler_cxx='g++ -O -Wall', + self.set_executables(compiler='gcc -O2 -Wall', + compiler_so='gcc -mdll -O2 -Wall', + compiler_cxx='g++ -O2 -Wall', linker_exe='gcc', linker_so='%s %s %s' % (self.linker_dll, shared_option,