Skip to content
Snippets Groups Projects
Commit 889ec4b9 authored by Teodor Sigaev's avatar Teodor Sigaev
Browse files

Fix Intel compiler bug. Per discussion

'GIN FailedAssertions on Itanium2 with Intel compiler' in pgsql-hackers,
http://archives.postgresql.org/pgsql-hackers/2006-08/msg01914.php
parent 642194ba
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gin/ginutil.c,v 1.5 2006/07/14 14:52:16 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/gin/ginutil.c,v 1.6 2006/09/05 18:25:10 teodor Exp $
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -122,7 +122,22 @@ compareEntries(GinState *ginstate, Datum a, Datum b) { ...@@ -122,7 +122,22 @@ compareEntries(GinState *ginstate, Datum a, Datum b) {
} }
static FmgrInfo* cmpDatumPtr=NULL; static FmgrInfo* cmpDatumPtr=NULL;
static bool needUnique = FALSE;
#if defined(__INTEL_COMPILER) && (defined(__ia64__) || defined(__ia64))
/*
* Intel Compiler on Intel Itanium with -O2 has a bug around
* change static variable by user function called from
* libc func: it doesn't change. So mark it as volatile.
*
* It's a pity, but it's impossible to define optimization
* level here.
*/
#define VOLATILE volatile
#else
#define VOLATILE
#endif
static bool VOLATILE needUnique = FALSE;
static int static int
cmpEntries(const void * a, const void * b) { cmpEntries(const void * a, const void * b) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment