Re: Interval aggregate regression failure (expected seems

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paesold <mpaesold(at)gmx(dot)at>, Michael Glaesemann <grzm(at)myrealbox(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Interval aggregate regression failure (expected seems
Date: 2005-11-07 19:22:37
Message-ID: 87irv4e002.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> I think we can still file this as a compiler bug, because I'm pretty sure
> the C spec does not allow rearrangement of floating-point calculations ...

It may have more to do with whether the floating point value can stay in a
floating point register long enough to complete the calculation.

IIRC, floating point registers are actually longer than a double so if the
entire calculation is done in registers and then the result rounded off to
store in memory it may get the right answer. Whereas if it loses the extra
bits on the intermediate values (the infinite repeating fractions) that might
be where you get the imprecise results.

It makes some sense that -mcpu and -march give the compiler enough information
to keep the intermediate results in registers more effectively.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-11-07 19:25:35 Re: Interval aggregate regression failure (expected seems
Previous Message Tom Lane 2005-11-07 19:03:49 Re: REL8_1_STABLE and HEAD

Browse pgsql-patches by date

  From Date Subject
Next Message Greg Stark 2005-11-07 19:25:35 Re: Interval aggregate regression failure (expected seems
Previous Message Tom Lane 2005-11-07 17:07:27 Re: Interval aggregate regression failure (expected seems