Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 21 Nov 2015 22:54:38 +0100
From: Szabolcs Nagy <>
Subject: Re: for information, gcc-4.2.3 miscompiles musl math

* Rich Felker <> [2015-11-21 15:15:51 -0500]:
> I just tested with 4.2.1 binaries from Aboriginal Linux and (1) was
> able to reproduce the bug, and (2) made it go away with your patch.
> Not only did the bogus out-of-range result go away; the new result is
> a bit-exact match for modern gcc.
> Conceptually, it seems to me that for code that explicitly uses
> float_t and double_t in expressions and only converts down to float or
> double with stores, -ffloat-store should be just as good (albeit
> overly pessimizing) as -fexcess-precision=standard. So IMO this looks
> like a really good solution, and might come in handy as hardening
> against mistakes in new compilers too. IIRC firm used to do this wrong
> and I would not be at all surprised if pcc gets it wrong.

i did the changes where i think it was necessary
(hypot has asm implementation on i386 though).

(in most cases the code already uses float_t, double_t
where this would matter.)

View attachment "0001-math-make-ffloat-store-work-on-i386.patch" of type "text/x-diff" (2259 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.