Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: NISHIYAMA Tomoaki <tomoakin@staff.kanazawa-u.ac.jp>
Cc: pgsql-hackers@postgresql.org, Magnus Hagander <magnus@hagander.net>
Date: 2011-12-08T17:46:19Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove troublesome Asserts in cost_mergejoin().

  2. Enable building with the Mingw64 compiler.

Attachments


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