pgsql: Further adjust degree-based trig functions for more portability. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Further adjust degree-based trig functions for more portability.
Date
Msg-id E1aN5aa-000544-4p@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Further adjust degree-based trig functions for more portability.

The last round didn't do it.  Per Noah Misch, the problem on at least
some machines is that the compiler pre-evaluates trig functions having
constant arguments using code slightly different from what will be used
at runtime.  Therefore, we must prevent the compiler from seeing constant
arguments to any of the libm trig functions used in this code.

The method used here might still fail if init_degree_constants() gets
inlined into the call sites.  That probably won't happen given the large
number of call sites; but if it does, we could probably fix it by making
init_degree_constants() non-static.  I'll avoid that till proven
necessary, though.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/65abaab547a5758b0d6d92df4af1663bb47d545f

Modified Files
--------------
src/backend/utils/adt/float.c |  134 +++++++++++++++++++++++++++--------------
1 file changed, 89 insertions(+), 45 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Adjust degree-based trig functions for more portability.
Next
From: Tom Lane
Date:
Subject: pgsql: Still further adjust degree-based trig functions for more portab