diff -urN a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py --- a/Lib/distutils/cygwinccompiler.py 2014-10-11 22:44:44.871007400 +0100 +++ b/Lib/distutils/cygwinccompiler.py 2014-10-11 22:44:47.486157000 +0100 @@ -330,9 +330,9 @@ else: no_cygwin = '' - self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, - compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, - compiler_cxx='g++%s -O -Wall' % no_cygwin, + self.set_executables(compiler='gcc%s -O2 -Wall' % no_cygwin, + compiler_so='gcc%s -mdll -O2 -Wall' % no_cygwin, + compiler_cxx='g++%s -O2 -Wall' % no_cygwin, linker_exe='gcc%s' % no_cygwin, linker_so='%s%s %s %s' % (self.linker_dll, no_cygwin,