https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61847
Bug ID: 61847
Summary: bug in gfortran runtime on OSX: digits cut off when
reading floating point number
Product: gcc
Version: 4.8.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: e2cd58e1 at opayq dot com
Created attachment 33154
-- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33154action=edit
source code
Reading a floating point number from a file cuts off digits, depending on the C
locale.
This happens on a Mac when the locale is set to de_DE UTF-8 (note: in german,
the comma is used as separator for digits, but gfortran probably shouldn't do
that). gcc is installed from homebrew, Mac OS X 10.9.4
Attached example was build executed with
gfortran -v -save-temps -Wall -Wextra -o bug bugf.f90 bug.c ./bug
It returns:
FAIL 1.
But shouldn't return something.
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.3_1/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin13.2.0
Configured with: ../configure --build=x86_64-apple-darwin13.2.0
--prefix=/usr/local/Cellar/gcc/4.8.3_1
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.8
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog
--with-isl=/usr/local/opt/isl --with-system-zlib
--enable-version-specific-runtime-libs --enable-libstdcxx-time=yes
--enable-stage1-checking --enable-checking=release --enable-lto
--disable-werror --with-pkgversion='Homebrew gcc 4.8.3_1'
--with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin
--disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc 4.8.3_1)
--
compilation output for
gfortran -v -save-temps -Wall -Wextra -o bug bugf.f90 bug.c
--
Driving: gfortran -mmacosx-version-min=10.9.3 -v -save-temps -Wall -Wextra -o
bug bugf.f90 bug.c -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.3_1/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin13.2.0
Configured with: ../configure --build=x86_64-apple-darwin13.2.0
--prefix=/usr/local/Cellar/gcc/4.8.3_1
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-4.8
--with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr
--with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog
--with-isl=/usr/local/opt/isl --with-system-zlib
--enable-version-specific-runtime-libs --enable-libstdcxx-time=yes
--enable-stage1-checking --enable-checking=release --enable-lto
--disable-werror --with-pkgversion='Homebrew gcc 4.8.3_1'
--with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin
--disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc 4.8.3_1)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-v' '-save-temps' '-Wall'
'-Wextra' '-o' 'bug' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc/4.8.3_1/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/f951
bugf.f90 -fPIC -quiet -dumpbase bugf.f90 -mmacosx-version-min=10.9.3
-mtune=core2 -auxbase bugf -Wall -Wextra -version -fintrinsic-modules-path
/usr/local/Cellar/gcc/4.8.3_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/finclude
-o bugf.s
GNU Fortran (Homebrew gcc 4.8.3_1) version 4.8.3 (x86_64-apple-darwin13.2.0)
compiled by GNU C version 4.8.3, GMP version 6.0.0, MPFR version 3.1.2-p8,
MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (Homebrew gcc 4.8.3_1) version 4.8.3 (x86_64-apple-darwin13.2.0)
compiled by GNU C version 4.8.3, GMP version 6.0.0, MPFR version 3.1.2-p8,
MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
bugf.f90:6.6:
if (res.ne.1.2345d0) write(*,*) 'FAIL', res
1
Warning: Inequality comparison for REAL(8) at (1)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-v' '-save-temps' '-Wall'
'-Wextra' '-o' 'bug' '-shared-libgcc' '-mtune=core2'
as -arch x86_64 -force_cpusubtype_ALL -o bugf.o bugf.s
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.9.3' '-v' '-save-temps' '-Wall'
'-Wextra' '-o' 'bug' '-shared-libgcc' '-mtune=core2'
/usr/local/Cellar/gcc/4.8.3_1/libexec/gcc/x86_64-apple-darwin13.2.0/4.8.3/cc1
-E -quiet -v -D__DYNAMIC__ bug.c -fPIC -mmacosx-version-min