Undefined Behavior in lib/msun/src/e_pow.c (was Re: New math library from ARM)

Pedro Giffuni pfg at FreeBSD.org
Tue Jan 1 03:32:14 UTC 2019


Hmm ...

Looking at the changes in musl's libc I found this issue which seems 
real (although somewhat theoretical):

https://git.musl-libc.org/cgit/musl/commit/src/math?id=688d3da0f1730daddbc954bbc2d27cc96ceee04c

Is the attached patch acceptable?


Also, their code is bit different here:

https://git.musl-libc.org/cgit/musl/commit/src/math?id=282b1cd26649d69de038111f5876853df6ddc345

but we may also have to check fmaf(-0x1.26524ep-54, -0x1.cb7868p+11, 
0x1.d10f5ep-29).

Cheers,

Pedro.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: msun-pow-ub.diff
Type: text/x-patch
Size: 435 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-numerics/attachments/20181231/8dc73c8f/attachment.bin>


More information about the freebsd-numerics mailing list