]> granicus.if.org Git - postgresql/commit
Further adjust degree-based trig functions for more portability.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 Jan 2016 21:17:31 +0000 (16:17 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 23 Jan 2016 21:17:31 +0000 (16:17 -0500)
commit65abaab547a5758b0d6d92df4af1663bb47d545f
tree4c99e44d3635cff7d70c983a22783fe57fd142eb
parent73193d82d7c8d849774bf6952dfb4287e213c572
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.
src/backend/utils/adt/float.c