aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gin/ginutil.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2006-09-05 18:25:10 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2006-09-05 18:25:10 +0000
commit889ec4b9981b9872e0a6e6be4b7cdeb611299257 (patch)
treefadd0ec7f0976c7d19fab078bf10d13ea11dab35 /src/backend/access/gin/ginutil.c
parent642194ba0cdc0aada9c99bf7712fcae5f3ac86d1 (diff)
downloadpostgresql-889ec4b9981b9872e0a6e6be4b7cdeb611299257.tar.gz
postgresql-889ec4b9981b9872e0a6e6be4b7cdeb611299257.zip
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
Diffstat (limited to 'src/backend/access/gin/ginutil.c')
-rw-r--r--src/backend/access/gin/ginutil.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c
index 9f1fd12b2cd..17eca3d239f 100644
--- a/src/backend/access/gin/ginutil.c
+++ b/src/backend/access/gin/ginutil.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* 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) {
}
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
cmpEntries(const void * a, const void * b) {