Issue #8211: Save/restore CFLAGS around AC_PROG_CC in configure.in, compiler
optimizations are disabled when --with-pydebug is used.
diff --git a/configure b/configure
index e6fc4d6..13e3d48 100755
--- a/configure
+++ b/configure
@@ -2367,6 +2367,7 @@
    { (exit 1); exit 1; }; }
 fi
 
+save_CFLAGS=$CFLAGS
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3286,6 +3287,7 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+CFLAGS=$save_CFLAGS