Skip site navigation (1) Skip section navigation (2)

Re: GIN FailedAssertions on Itanium2 with Intel compiler

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Sergey E(dot) Koposov" <math(at)sai(dot)msu(dot)ru>
Subject: Re: GIN FailedAssertions on Itanium2 with Intel compiler
Date: 2006-08-31 09:48:09
Message-ID: 44F6B059.2040701@sigaev.ru (view raw or flat)
Thread:
Lists: pgsql-hackers
Huh, it's a over-optimization by icc on Itanium. With -00 or -02 there is no any 
problem, only -O2 produces such effect. The problem is in code at lines 125-172 
in ginutils.c:

static bool needUnique = false;

int cmpFunc(...) {
	...
	if (...) needUnique = true;
	...
}
...
needUnique = false;
qsort(...., cmpFunc);
if (needUnique) ....

And, needUnique was setted to true in last call of cmpFunc (by accident, in 
fact), so between last call and checking of needUnique there isn't any call of 
function. Insertion after qsort() any call (elog, for example) solves the problem.

If needUnique is marked as "volatile", all is ok too. But this way doesn't seem 
to me as reasonable, because there is a lot of places with potentially the same 
problem... and thats may cause unpredictable failures. May be, better way is 
limiting optimization level on Itanium with icc.





-- 
Teodor Sigaev                                   E-mail: teodor(at)sigaev(dot)ru
                                                    WWW: http://www.sigaev.ru/

In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2006-08-31 11:56:29
Subject: Prepared statements considered harmful
Previous:From: Stefan KaltenbrunnerDate: 2006-08-31 09:29:38
Subject: Re: [PATCHES] Backend SSL configuration enhancement

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group