diff --git a/config/gcc.conf b/config/gcc.conf
index d0ee7c7..d4c4aac 100644
--- a/config/gcc.conf
+++ b/config/gcc.conf
@@ -67,6 +67,14 @@ if test x"${build}" != x"${target}"; then
    # able to use the C library built with the first GCC build.
    stage1_flags="--disable-libssp --disable-libquadmath --disable-threads --without-headers --with-newlib --disable-libmudflap --disable-bootstrap --disable-decimal-float --disable-libgomp --disable-libatomic --disable-libsanitizer --disable-plugins --disable-libitm MAKEINFO=echo --enable-languages=c --with-sysroot=${local_builds}/sysroot-${target} --disable-shared --with-glibc-version=2.18"
 
+    # Add host specific flags.
+    case ${host} in
+	*-mingw32)
+	    # Debian jessie 8.4 mingw g++-4.9.1 generates bad code at -O2.  Miscompiles tree-ssa-ccp.c.  Override here.
+	    default_configure_flags="${default_configure_flags} CFLAGS='-O -g' CXXFLAGS='-O -g'"
+	    ;;
+    esac
+
    # Add platform specific flags
     case ${target} in
 	armv8l-*linux-gnueabihf)
