On Sun, Aug 05, 2007 at 11:20:18AM -0400, Tom Lane wrote:
> "Dirk Tilger" <[EMAIL PROTECTED]> writes:
> > Operating system:   Linux with Intel compiler on ia64
> 
> > I have been compiling postgresql 8.0, 8.1 and 8.2.4 with the Intel compiler
> > in the past successfully. This time something went wrong and although I
> > can't tell precisely how I triggered it, I have found a fix.
> 
> BTW, what I found in googling suggested that (1) icc never has defined
> __ICC on 64-bit machines, and (2) although it does define __GNUC__ by
> default, there is a way to turn that off.  So I surmise that your
> relevant change was adding a compiler flag that disabled the definition
> of __GNUC__.  That doesn't seem to have stopped it from accepting
> GNU-style asm directives, though, so I kinda wonder what compiler
> behavior does change and what was the point of your flag change.

The compiler seems to have been called with:

| icc -mp -no-gcc -mcpu=itanium2 -mtune=itanium2

The manual page about '-no-gcc' says:

-no-gcc
        Do not predefine the __GNUC__, __GNUC_MINOR__, and __GNUC_PATCHLEVEL__ 
        macros.

FYI: we also apply the attached patch to postgre, so that the 
'configure' script would not add the -mp1, when -mp was already 
specified. From the manual:

|      -mp    Maintain floating-point precision  (disables  some  opti-
|             mizations).  The  -mp  option  restricts  optimization to
|             maintain declared precision and  to  ensure  that  float-
|             ing-point  arithmetic  conforms  more closely to the ANSI
|             and IEEE standards. For most  programs,  specifying  this
|             option adversely affects performance. If you are not sure
|             whether your application needs this option, try compiling
|             and  running  your  program  both  with and without it to
|             evaluate the effects on both performance and precision.
|
|
|      -mp1   Improve floating-point  precision.  -mp1  disables  fewer
|             optimizations  and  has  less  impact on performance than
|             -mp.

Best regards,
Dirk Tilger.
--- postgresql-8.1.5/configure.in       2006-10-12 23:41:27.000000000 +0400
+++ postgresql-8.1.5-patched/configure.in       2007-04-01 18:35:40.000000000 
+0400
@@ -266,11 +266,6 @@
 
     PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
     PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
-  else
-    # Intel compiler has a bug/misoptimization in checking for
-    # division by NAN (NaN == 0), -mp1 fixes it, so add it to the
-    # CFLAGS.
-    PGAC_PROG_CC_CFLAGS_OPT([-mp1])
   fi
 
   # Disable strict-aliasing rules; needed for gcc 3.3+
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to