Bug 175393 - gfotran internal write fails after internal read
Summary: gfotran internal write fails after internal read
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-09 18:44 UTC by David Mastronarde
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.1.0-0.6
Clone Of:
Environment:
Last Closed: 2005-12-12 14:50:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Mastronarde 2005-12-09 18:44:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
After an internal read from a character string just big enough to hold a number,
an internal write to a longer format gives an End of record error.

      character*80 card
      real*4 xnum
      character*9 tim
      character*10 packtime
c
      card = '23 45 78'
      packtime = '123403.123'
      print *,'before write'
      write(tim,101)packtime(1:2)
101   format(a2,'-')         ! It runs if format is just a2
      read(card(1:2),*)XNUM  ! It runs if longer string than 1:2 is given
      print *,'after read'
      write(tim,101)packtime(1:2)
      print *,'after write'
      call exit(0)
      end


Version-Release number of selected component (if applicable):
gcc-gfortran-4.0.2-8.fc4

How reproducible:
Always

Steps to Reproduce:
1. Compile above program,  gfortran -o readtst readtst.f
2. Run program
3.
  

Actual Results:  [druid] blend 334 % gfortran -o readtst readtst.f
[druid] blend 335 % readtst
 before write
 after read
At line 13 of file readtst.f
Fortran runtime error: End of record


Expected Results:  [druid] blend 336 % g77 -o readtst readtst.f
[druid] blend 337 % readtst
 before write
 after read
 after write


Additional info:

This does not fail on Mac OSX 10.4 with:
gcc version 4.1.0 20051026 (experimental)

So maybe it is fixed already, or maybe it is system dependent

Comment 1 Jakub Jelinek 2005-12-12 14:50:57 UTC
Works just fine in gcc-gfortran-4.1.0-0.6 (in Fedora development).
There are several fixes that haven't been applied to 4.0.x and probably aren't
going to be.


Note You need to log in before you can comment on or make changes to this bug.