Re: GIN FailedAssertions on Itanium2 with Intel compiler - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: GIN FailedAssertions on Itanium2 with Intel compiler
Date
Msg-id 44F6B059.2040701@sigaev.ru
Whole thread Raw
In response to GIN FailedAssertions on Itanium2 with Intel compiler  ("Sergey E. Koposov" <math@sai.msu.ru>)
Responses Re: GIN FailedAssertions on Itanium2 with Intel compiler
Re: GIN FailedAssertions on Itanium2 with Intel compiler
List 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@sigaev.ru
  WWW: http://www.sigaev.ru/
 


pgsql-hackers by date:

Previous
From: "Victor B. Wagner"
Date:
Subject: Re: [PATCHES] Backend SSL configuration enhancement
Next
From: Peter Eisentraut
Date:
Subject: Prepared statements considered harmful