Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow" - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"
Date
Msg-id CAApHDvohQiCYqoKPP-k0GK1AtTcCXD0VSafrCDU3yqYvigUwVg@mail.gmail.com
Whole thread
In response to Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"  (Andrey Rachitskiy <pl0h0yp1@gmail.com>)
List pgsql-bugs
On Wed, 5 Aug 2026 at 05:11, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> v2 drops escontext.  The helpers are plain float8-returning wrappers
> around the existing noreturn float_*_error() calls.  The return 0.0 is
> never reached.  It is only there so the compiler treats the call as an
> ordinary returning call.  That CFG change is what keeps gcc 13+ jump
> threading from deleting the outer isinf() check in float8_mul().

IMO, this seems like a reasonably clean way to resolve the issue. I
think it's quite good that we don't need to consider when to remove
this once the GCC fix is patched out of existence. Since master has a
good reason for using this pattern, that's going to stay, and we can
let this fix die as the back branches age out.

The outstanding question I have is, out of all the isinf(x) &&
!isinf(y) checks, is float8_mul() the only one that suffers from this?
Is it worth writing a set of regression tests that verify that's the
case, so we can have some confidence that we've not missed something
here?

David



pgsql-bugs by date:

Previous
From: Andrey Rachitskiy
Date:
Subject: Re: BUG #19593: area(circle) silently returns Infinity instead of raising "value out of range: overflow"
Next
From: Nitin Motiani
Date:
Subject: Re: BUG #19588: Semantically equivalent DISTINCT ON query returns different result when wrapped in MATERIALIZED CTE.