On 12/05/2011 06:27 PM, Andrew Dunstan wrote:


   $ cat regression.diffs
   ***
C:/MinGW/msys/1.0/home/pgrunner/bf/root32/HEAD/pgsql/src/test/regress/expected/float8-exp-three-digits-win32.out Fri Nov 25 14:24:49 2011
   ---
C:/MinGW/msys/1.0/home/pgrunner/bf/root32/HEAD/pgsql/src/test/regress/results/float8.out Mon Dec 5 18:17:36 2011
   ***************
   *** 382,388 ****
         SET f1 = FLOAT8_TBL.f1 * '-1'
         WHERE FLOAT8_TBL.f1 > '0.0';
      SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
   ! ERROR:  value out of range: overflow
      SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
      ERROR:  value out of range: overflow
      SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;
   --- 382,396 ----
         SET f1 = FLOAT8_TBL.f1 * '-1'
         WHERE FLOAT8_TBL.f1 > '0.0';
      SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;
   !  bad |     ?column?
   ! -----+------------------
   !      |                0
   !      |      -3.484e+201
   !      |     -1.0043e+203
   !      |        -Infinity
   !      | -1.2345678901234
   ! (5 rows)
   !
      SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;
      ERROR:  value out of range: overflow
      SELECT 0 ^ 0 + 0 ^ 1 + 0 ^ 0.0 + 0 ^ 0.5;

   ======================================================================





This is apparently an optimization bug in the compiler. If I turn optimization off (CFLAGS=-O0) it goes away. Ick.

So at the moment I'm a bit blocked. I can't really file a bug because the compiler can't currently be used to build postgres, I don't have time to construct a self-contained test case, and I don't want to commit changes to enable the compiler until the issue is solved.

FYI I've been testing with the attached patch. We'll need to construct a configure test for HAVE_CRTDEFS_H.

cheers

andrew


diff --git a/config/ac_func_accept_argtypes.m4 b/config/ac_func_accept_argtypes.m4
index 1e77179..a82788d 100644
--- a/config/ac_func_accept_argtypes.m4
+++ b/config/ac_func_accept_argtypes.m4
@@ -46,7 +46,7 @@ AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES],
  [AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl
   [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl
    [AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
-    [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
+    [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
diff --git a/configure b/configure
index de9ba5a..fbafa4b 100755
--- a/configure
+++ b/configure
@@ -17998,6 +17998,7 @@ fi
 # probing existence of related functions such as fseeko, since the largefile
 # defines can affect what is generated for that.
 # Check whether --enable-largefile was given.
+if test "$PORTNAME" != "win32" ; then
 if test "${enable_largefile+set}" = set; then
   enableval=$enable_largefile;
 fi
@@ -18352,6 +18353,7 @@ esac
 rm -rf conftest*
   fi
 fi
+fi
 
 
 # Check for largefile support (must be after AC_SYS_LARGEFILE)
@@ -18808,7 +18810,7 @@ else
      if test "${ac_cv_func_accept_arg3+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-      for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
+      for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET WSAAPI'; do
       for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
diff --git a/src/include/c.h b/src/include/c.h
index 0391860..cb9b150 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -58,7 +58,8 @@
 #endif
 #include "postgres_ext.h"
 
-#if _MSC_VER >= 1400 || defined(WIN64)
+#define HAVE_CRTDEFS_H 1
+#if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H)
 #define errcode __msvc_errcode
 #include <crtdefs.h>
 #undef errcode
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 34f4004..49da684 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -31,7 +31,7 @@
  * The Mingw64 headers choke if this is already defined - they
  * define it themselves.
  */
-#if !defined(WIN64) || defined(WIN32_ONLY_COMPILER)
+#if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER)
 #define _WINSOCKAPI_
 #endif
 #include <winsock2.h>
@@ -225,9 +225,13 @@ int			setitimer(int which, const struct itimerval * value, struct itimerval * ov
 #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
 #define ftello(stream) _ftelli64(stream)
 #else
+#ifndef fseeko
 #define fseeko(stream, offset, origin) fseeko64(stream, offset, origin)
+#endif
+#ifndef ftello
 #define ftello(stream) ftello64(stream)
 #endif
+#endif
 
 /*
  * Supplement to <sys/types.h>.
@@ -264,6 +268,7 @@ typedef int pid_t;
 #undef EINTR
 #define EINTR WSAEINTR
 #define EAGAIN WSAEWOULDBLOCK
+#ifndef EMSGSIZE
 #define EMSGSIZE WSAEMSGSIZE
 #define EAFNOSUPPORT WSAEAFNOSUPPORT
 #define EWOULDBLOCK WSAEWOULDBLOCK
@@ -272,8 +277,13 @@ typedef int pid_t;
 #define ENOBUFS WSAENOBUFS
 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
 #define ECONNREFUSED WSAECONNREFUSED
+#endif
+#ifndef EBADFD
 #define EBADFD WSAENOTSOCK
+#endif
+#ifndef EOPNOTSUPP
 #define EOPNOTSUPP WSAEOPNOTSUPP
+#endif
 
 /*
  * Extended locale functions with gratuitous underscore prefixes.
diff --git a/src/interfaces/ecpg/test/resultmap b/src/interfaces/ecpg/test/resultmap
index 95ea583..70576b6 100644
--- a/src/interfaces/ecpg/test/resultmap
+++ b/src/interfaces/ecpg/test/resultmap
@@ -4,6 +4,8 @@ compat_informix/dec_test:stdout:x86_64-w64-mingw32=compat_informix-dec_test-MinG
 pgtypeslib/num_test:stdout:i.86-pc-win32vc=pgtypeslib-num_test-MinGW32.stdout
 pgtypeslib/num_test:stdout:i.86-pc-mingw32=pgtypeslib-num_test-MinGW32.stdout
 pgtypeslib/num_test:stdout:x86_64-w64-mingw32=pgtypeslib-num_test-MinGW32.stdout
+pgtypeslib/num_test:stdout:i.86-w64-mingw32=pgtypeslib-num_test-MinGW32.stdout
 pgtypeslib/num_test2:stdout:i.86-pc-win32vc=pgtypeslib-num_test2-MinGW32.stdout
 pgtypeslib/num_test2:stdout:i.86-pc-mingw32=pgtypeslib-num_test2-MinGW32.stdout
 pgtypeslib/num_test2:stdout:x86_64-w64-mingw32=pgtypeslib-num_test2-MinGW32.stdout
+pgtypeslib/num_test2:stdout:i.86-w64-mingw32=pgtypeslib-num_test2-MinGW32.stdout
diff --git a/src/port/getaddrinfo.c b/src/port/getaddrinfo.c
index db19878..b6368ae 100644
--- a/src/port/getaddrinfo.c
+++ b/src/port/getaddrinfo.c
@@ -328,12 +328,10 @@ gai_strerror(int errcode)
 		case EAI_MEMORY:
 			return "Not enough memory";
 #endif
-#ifdef EAI_NODATA
-#if !defined(WIN64) && !defined(WIN32_ONLY_COMPILER)	/* MSVC/WIN64 duplicate */
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME /* MSVC/WIN64 duplicate */
 		case EAI_NODATA:
 			return "No host data of that type was found";
 #endif
-#endif
 #ifdef EAI_SERVICE
 		case EAI_SERVICE:
 			return "Class type not found";
diff --git a/src/test/regress/resultmap b/src/test/regress/resultmap
index d02d221..04ba99f 100644
--- a/src/test/regress/resultmap
+++ b/src/test/regress/resultmap
@@ -1,5 +1,6 @@
 float4:out:i.86-pc-mingw32=float4-exp-three-digits.out
 float4:out:x86_64-w64-mingw32=float4-exp-three-digits.out
+float4:out:i.86-w64-mingw32=float4-exp-three-digits.out
 float4:out:i.86-pc-win32vc=float4-exp-three-digits.out
 float8:out:i.86-.*-freebsd=float8-small-is-zero.out
 float8:out:i.86-.*-openbsd=float8-small-is-zero.out
@@ -7,8 +8,10 @@ float8:out:i.86-.*-netbsd=float8-small-is-zero.out
 float8:out:m68k-.*-netbsd=float8-small-is-zero.out
 float8:out:i.86-pc-mingw32=float8-exp-three-digits-win32.out
 float8:out:x86_64-w64-mingw32=float8-exp-three-digits-win32.out
+float8:out:i.86-w64-mingw32=float8-exp-three-digits-win32.out
 float8:out:i.86-pc-win32vc=float8-exp-three-digits-win32.out
 float8:out:i.86-pc-cygwin=float8-small-is-zero.out
 int8:out:i.86-pc-mingw32=int8-exp-three-digits.out
 int8:out:x86_64-w64-mingw32=int8-exp-three-digits.out
+int8:out:i.86-w64-mingw32=int8-exp-three-digits.out
 int8:out:i.86-pc-win32vc=int8-exp-three-digits.out
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to