public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41168]  New: incorrect processing of formatted records in mingw port
@ 2009-08-25 18:26 michael dot a dot richmond at nasa dot gov
  2009-08-26  0:39 ` [Bug fortran/41168] " jvdelisle at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2009-08-25 18:26 UTC (permalink / raw)
  To: gcc-bugs

The following bug occurs only in the version of gfortran downloaded from
ftp://ftp.equation.com/gcc/gcc-4.5-20090820-32.exe.

When I compile and run the program listed below it prints:

 1234567890
 1234567890
 end of file not detected

On every other port of gfortran it prints:

 1234567890
 end of file detected

PROGRAM read_character_string_bug
CHARACTER(LEN=10) :: line_10
CHARACTER(LEN=11) :: line_11
line_10 = "1234567890"
OPEN(10, FILE="test.txt", STATUS="UNKNOWN", FORM="FORMATTED")
WRITE(10, 20) line_10
20 FORMAT(a)
REWIND(10)
DO i = 1, 2
  READ(10, 20, END=99) line_11
  PRINT *, line_11
ENDDO
PRINT *, "end of file not detected"
STOP
99 PRINT *, "end of file detected"
END PROGRAM read_character_string_bug


-- 
           Summary: incorrect processing of formatted records in mingw port
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: i386-pc-mingw32
GCC target triplet: i386-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
@ 2009-08-26  0:39 ` jvdelisle at gcc dot gnu dot org
  2009-08-26  1:03 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-08-26  0:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2009-08-26 00:39 -------
Works for me on latest trunk. 4.5

$ ./a.out 
 1234567890 
 end of file detected

Please post the output from gfortran -v and also the exact URL where you got
the download.  The binaries from the wiki are unofficial and provided for
testing convenience.  Regardless, we should see what is going on here.




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
  2009-08-26  0:39 ` [Bug fortran/41168] " jvdelisle at gcc dot gnu dot org
@ 2009-08-26  1:03 ` jvdelisle at gcc dot gnu dot org
  2009-08-26 16:47 ` michael dot a dot richmond at nasa dot gov
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-08-26  1:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2009-08-26 01:03 -------
oops, you got it from equation.com.  Hmm, I don't know much how they create
their distribution.Suggest you contact them and see what they think.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
  2009-08-26  0:39 ` [Bug fortran/41168] " jvdelisle at gcc dot gnu dot org
  2009-08-26  1:03 ` jvdelisle at gcc dot gnu dot org
@ 2009-08-26 16:47 ` michael dot a dot richmond at nasa dot gov
  2009-09-03 14:19 ` fxcoudert at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2009-08-26 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from michael dot a dot richmond at nasa dot gov  2009-08-26 16:47 -------
The output from typing "gfortran -v" is listed below. It is a
cross-compilation, if that is significant.

Built by Equation Solution <http://www.Equation.com>.
Using built-in specs.
Target: i386-pc-mingw32
Configured with: ../gcc-4.5-20090820-mingw/configure --host=i386-pc-mingw32
--build=x86_64-unknown-linux-gnu --target=i386-pc-mingw32
--prefix=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/gcc/4.5-20090820
--with-gcc --with-gnu-ld --with-gnu-as --disable-shared --disable-nls
--disable-tls
--with-gmp=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/gmp
--with-mpfr=/home/gfortran/gcc-home/binary/mingw32/native/x86_32/mpfr
--enable-languages=c,fortran,c++
--with-sysroot=/home/gfortran/gcc-home/binary/mingw32/cross/x86_32/gcc/4.5-20090820
--enable-libgomp --enable-threads=win32 --disable-win32-registry
Thread model: win32
gcc version 4.5.0 20090820 (experimental) (GCC) 

I have not been able to build a mingw port from the source code. If anybody has
a procedure for doing so, please contact me.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (2 preceding siblings ...)
  2009-08-26 16:47 ` michael dot a dot richmond at nasa dot gov
@ 2009-09-03 14:19 ` fxcoudert at gcc dot gnu dot org
  2009-09-03 18:12 ` michael dot a dot richmond at nasa dot gov
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-09-03 14:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2009-09-03 14:19 -------
I can confirm I can reproduce this bug with an darwin-to-mingw cross-compiler,
and running the executable under wine.

I can also confirm that it's about the REWIND statement: if you have already
run the test program once, you can recompile it without the WRITE and the
REWIND, using the already existing testcase. Then, it passes OK.

It's probably some bad counting of position on platforms with HAVE_CRLF. To
investigate, it should be possible to build such a faulty linux compiler by
forcing HAVE_CRLF to be true.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-09-03 14:19:20
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (3 preceding siblings ...)
  2009-09-03 14:19 ` fxcoudert at gcc dot gnu dot org
@ 2009-09-03 18:12 ` michael dot a dot richmond at nasa dot gov
  2009-09-04 23:09 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2009-09-03 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from michael dot a dot richmond at nasa dot gov  2009-09-03 18:12 -------
(In reply to comment #4)
> It's probably some bad counting of position on platforms with HAVE_CRLF. To
> investigate, it should be possible to build such a faulty linux compiler by
> forcing HAVE_CRLF to be true.

I tried to do this in the i686-pc-linux-gnu port of gfortran. In the file
libgfortran/config.h.in I changed "#undef HAVE_CRLF" to "#define HAVE_CRLF".
When I built gfortran, the change was propagated to libgfortran/config.h. But
when I ran the test case it created a file with standard Linux carriage
control.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (4 preceding siblings ...)
  2009-09-03 18:12 ` michael dot a dot richmond at nasa dot gov
@ 2009-09-04 23:09 ` jvdelisle at gcc dot gnu dot org
  2009-09-08 10:04 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-09-04 23:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2009-09-04 23:09 -------
I will add this to my list.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-09-03 14:19:20         |2009-09-04 23:09:30
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (5 preceding siblings ...)
  2009-09-04 23:09 ` jvdelisle at gcc dot gnu dot org
@ 2009-09-08 10:04 ` burnus at gcc dot gnu dot org
  2009-09-08 15:21 ` michael dot a dot richmond at nasa dot gov
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-09-08 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2009-09-08 10:04 -------
Is the problem described at http://gcc.gnu.org/ml/fortran/2009-09/msg00046.html
the same or a different one?

There, it is claimed to be a 4.5 regression.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (6 preceding siblings ...)
  2009-09-08 10:04 ` burnus at gcc dot gnu dot org
@ 2009-09-08 15:21 ` michael dot a dot richmond at nasa dot gov
  2009-09-09  0:58 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2009-09-08 15:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from michael dot a dot richmond at nasa dot gov  2009-09-08 15:21 -------
(In reply to comment #7)
> Is the problem described at http://gcc.gnu.org/ml/fortran/2009-09/msg00046.html
> the same or a different one?
> 
> There, it is claimed to be a 4.5 regression.
> 

I verified the problem described in
http://gcc.gnu.org/ml/fortran/2009-09/msg00046.html. I found that my bug does
not occur under gfortran 4.4.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (7 preceding siblings ...)
  2009-09-08 15:21 ` michael dot a dot richmond at nasa dot gov
@ 2009-09-09  0:58 ` jvdelisle at gcc dot gnu dot org
  2009-09-09  2:12 ` jvdelisle at gcc dot gnu dot org
  2009-09-11  5:38 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-09-09  0:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jvdelisle at gcc dot gnu dot org  2009-09-09 00:58 -------
It is not clear whether we have two bugs or one here yet.  I am investigating. 
One way to possibly reproduce this on linux machines is to define HAVE_CRLF in
libgfortran/io/io.h.  This way, all files affected by that define will be
re-compiled.  I am trying this and will report back if i can reproduce the
problem. (I too have still been unable to build a mingw compiler.  I tried an
automatic script pointed out by Kai and Nightstrike and it failed. I never give
up.)  

:) yet


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (8 preceding siblings ...)
  2009-09-09  0:58 ` jvdelisle at gcc dot gnu dot org
@ 2009-09-09  2:12 ` jvdelisle at gcc dot gnu dot org
  2009-09-11  5:38 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-09-09  2:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2009-09-09 02:11 -------
I am able to reproduce this now, so I will begin to see if I can pinpoint the
problem.

Using:

Index: io.h
===================================================================
--- io.h        (revision 151491)
+++ io.h        (working copy)
@@ -30,7 +30,7 @@
 /* IO library include.  */

 #include "libgfortran.h"
-
+#define HAVE_CRLF
 #include <setjmp.h>
 #include <gthr.h>



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/41168] incorrect processing of formatted records in mingw port
  2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
                   ` (9 preceding siblings ...)
  2009-09-09  2:12 ` jvdelisle at gcc dot gnu dot org
@ 2009-09-11  5:38 ` jvdelisle at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-09-11  5:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2009-09-11 05:38 -------
PR41328 was submitted which has a little bit easier test case to use while not
requiring mingw environment.  So, I am closing this bug as the duplicate even
though it was reported here first.

A patch has been submitted for approval. See:

http://gcc.gnu.org/ml/fortran/2009-09/msg00062.html

Thanks much for this bug report.  The test case was very useful.  In fact, I
was onto the problem before the other PR was reported.

*** This bug has been marked as a duplicate of 41328 ***


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41168


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-09-11  5:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25 18:26 [Bug fortran/41168] New: incorrect processing of formatted records in mingw port michael dot a dot richmond at nasa dot gov
2009-08-26  0:39 ` [Bug fortran/41168] " jvdelisle at gcc dot gnu dot org
2009-08-26  1:03 ` jvdelisle at gcc dot gnu dot org
2009-08-26 16:47 ` michael dot a dot richmond at nasa dot gov
2009-09-03 14:19 ` fxcoudert at gcc dot gnu dot org
2009-09-03 18:12 ` michael dot a dot richmond at nasa dot gov
2009-09-04 23:09 ` jvdelisle at gcc dot gnu dot org
2009-09-08 10:04 ` burnus at gcc dot gnu dot org
2009-09-08 15:21 ` michael dot a dot richmond at nasa dot gov
2009-09-09  0:58 ` jvdelisle at gcc dot gnu dot org
2009-09-09  2:12 ` jvdelisle at gcc dot gnu dot org
2009-09-11  5:38 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).