[PATCH v2] Avoid undefined behaviour in ibm128 implementation of llroundl

Michael Hudson-Doyle michael.hudson@canonical.com
Mon Aug 22 08:52:03 GMT 2022


On Mon, 22 Aug 2022, 20:34 Andreas Schwab, <schwab@suse.de> wrote:

> On Aug 22 2022, Michael Hudson-Doyle via Libc-alpha wrote:
>
> > @@ -69,7 +70,7 @@ __llroundl (long double x)
> >        res = hi + lo;
>
> The overflow happens here.  Changing the type of the LHS does not change
> that.
>

IIRC it was one of the "res += 1"s lower down in the test case that was
failing for me. But maybe a more thorough rewrite of this function is
called for (if people still care about ibm128 I guess).

Cheers,
mwh

-- 
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>


More information about the Libc-alpha mailing list