Bug 13032 – std.internal.math.gammfunction assumes 80-bit real

Status
NEW
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-03T15:21:19Z
Last change time
2024-12-01T16:21:42Z
Assigned to
No Owner
Creator
Johannes Pfau
Moved to GitHub: phobos#10067 →

Comments

Comment #0 by johannespfau — 2014-07-03T15:21:19Z
std.internal.math.gammfunction assumes that reals are in x86 Extended Precision Format. This is only true for x86 and gammafunction is actually the only module with failing tests on ARM. A simple way to test for systems where real==double is to use the -mlong-double flag with gdc: ---- #Install gdc via linux distribution or from gdcproject.org/downloads/ wget http://gdcproject.org/downloads/binaries/x86_64-linux-gnu/native_2.065_gcc4.9.0_a8ad6a6678_20140615.tar.xz tar xf native_2.065_gcc4.9.0_a8ad6a6678_20140615.tar.xz wget https://raw.githubusercontent.com/D-Programming-GDC/GDC/master/libphobos/src/std/internal/math/gammafunction.d echo "void main(){}" > main.d # With default precision, tests should pass on x86 systems ./x86_64-gdcproject-linux-gnu/bin/x86_64-unknown-linux-gnu-gdc gammafunction.d main.d -funittest -g ./a.out # With real==double precision, tests fail ./x86_64-gdcproject-linux-gnu/bin/x86_64-unknown-linux-gnu-gdc gammafunction.d main.d -funittest -g -mlong-double-64 ./a.out ----
Comment #1 by johannespfau — 2014-07-03T17:07:02Z
Sorry, testing is not as simple as I initially thought. Mixing code compiled with -mlong-double-64 and code compiled without is not possible. So in order to test this on x86 gdc needs to be built from source and phobos/drutime have to be compiled with "-mlong-double-64" as well. Use DFLAGS="-mlong-double-64" ./configure DFLAGS="-mlong-double-64" make for this. It might be simpler to just use one of the existing ARM (cross)compilers and test on an ARM system.
Comment #2 by robert.schadek — 2024-12-01T16:21:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10067 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB