diff -Naur Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py Python-3.8.0/Lib/distutils/cygwinccompiler.py
--- Python-3.8.0-orig/Lib/distutils/cygwinccompiler.py	2019-10-22 10:03:07.686966400 +0300
+++ Python-3.8.0/Lib/distutils/cygwinccompiler.py	2019-10-22 10:04:03.316664100 +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,
