Re: patch to have configure check if CC is intel C compiler

From: Jeremy Drake <pgsql-patches(at)jdrake(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: patch to have configure check if CC is intel C compiler
Date: 2006-04-22 02:45:44
Message-ID: Pine.LNX.4.64.0604211925480.13056@frousa
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Fri, 21 Apr 2006, Tom Lane wrote:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > This seems like a compiler bug so I am hoping it will be fixed, or is
> > already fixed in a later release.
>
> Yeah. NaN == 0 is just silly ...

From what I can tell from the instruction set docs and test programs, the
actual bug/misoptimization is that NaN == anything. Which is even
sillier.

I actually thought that this was a bug at first, but on further
investigation and reading I decided it was a "feature". Because the -mp1
option is supposed to give results closer to ANSI and IEEE standards,
specifically with regards to "NaN comparison semantics". Since the only
difference in the relevant machine code adding this option is the check
for the "unordered" result of the compare, I assume intel made a decision
to skip the check, rather than forgetting to check.

I managed to find the user's guide online via google, this is the
documentation for the -mp1 option:
http://ruth.georgetown.edu/comp/intel_cc_90/main_cls/mergedProjects/copts_cls/common_options/option_mp1_lcase.htm

Also, as regards -fno-strict-aliasing, the man page says that the default
options "Assume aliasing in the program", "Assume aliasing within
functions", and "Assume arguments may be aliased". The
-fno-strict-aliasing option is not listed in the man page, but it does not
complain about it either, and I figured better to include it than to leave
it out and risk obscure bugs. It looks like the option for strict
aliasing is -ansi-alias which assumes "that the program adheres to the
rules defined in the ISO C Standard".

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-04-22 03:07:07 Re: [HACKERS] Automatically setting work_mem
Previous Message Tom Lane 2006-04-22 02:01:21 Re: patch to have configure check if CC is intel C compiler