gfortran bugs
Jerry DeLisle
jvdelisle@verizon.net
Tue Jan 8 13:03:00 GMT 2008
Jean-Philippe Chancelier wrote:
> Hello,
>
> I do not know if you are the good person but
> I wanted to report troubles with fortran io.
> The problems appear with a gfortran 4.2.2 used
> as a cross compiler (but this is certainly not a
> cross compilation pb).
> Regards
> Jean-Philippe Chancelier
>
> program bug
> double precision x
> character*10 str
> character*10 fmt
> x=7.0
> write(fmt,120) 3,0
> write(str,fmt) x
> write(06,*) str
> 120 format('(f',i2,'.',i2,')')
> end
>
You have indeed found a bug. It only occurs with the mingw32 binary. I
confirmed this: Using built-in specs.
Target: i686-pc-mingw32
Configured with: ../gcc43/configure --prefix=/mingw --enable-languages=c,fortran
--disable-nls --with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror
--enable-bootstrap --build=i386-pc-mingw32 --disable-shared --build=i686-pc-mingw32
Thread model: win32
gcc version 4.3.0 20070813 (experimental)
It works fine with the Cygwin build I have which is: gcc version 4.3.0 20071222
(experimental) [trunk revision 127783] (GCC)
>
> clio% make bug ; ./bug
> i686-pc-mingw32-gfortran -g -O2 bug.f -o bug
> *** <------ !!!!
>
> The correct output should be
>
> clio% gfortran -o bug bug.f; ./bug
> 7.
>
> If x=7.0 is replaced by x=1.0
>
> clio% make bug ; ./bug
> i686-pc-mingw32-gfortran -g -O2 bug.f -o bug
> 0. <------ !!!!
>
> The correct output should be
>
> gfortran -o bug bug.f ; ./bug
> 1.
I will submit a bug report. Thankyou for the report. Please, in future, post
questions to fortran@gcc.gnu.org so that others may see.
Jerry
More information about the Fortran
mailing list