[gfortran] patch for PR 15755 - bus error on backspace

Bud Davis bdavis9659@comcast.net
Wed Jun 2 04:12:00 GMT 2004


Tested with no additional test suite failures i686/gnu/linux FC1.



--bud



2004-06-02  Bud Davis  <bdavis9659@comcast.net>

	PR gfortran/15755
	* io/backspace.c(st_backspace): call correct routine for
	formatted and un-formatted units.

$ cat backspace.f90
! pr 15755
        implicit none
        character*1 C
        open(10)
        write(10,*)'a'
        write(10,*)'b'
        write(10,*)'c'
        rewind(10)
        read(10,*)C
        backspace(10)
        read(10,*) C
        if (C.ne.'b') call abort
        close(10,STATUS='DELETE')
        end



Index: gcc/libgfortran/io/backspace.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/backspace.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 backspace.c
*** gcc/libgfortran/io/backspace.c	18 May 2004 16:06:09 -0000	1.4
--- gcc/libgfortran/io/backspace.c	2 Jun 2004 02:52:54 -0000
*************** st_backspace (void)
*** 149,155 ****
        if (file_position (u->s) == 0)
  	goto done;		/* Common special case */
  
!       if (u->flags.form == FORM_UNFORMATTED)
  	formatted_backspace ();
        else
  	unformatted_backspace ();
--- 149,155 ----
        if (file_position (u->s) == 0)
  	goto done;		/* Common special case */
  
!       if (u->flags.form == FORM_FORMATTED)
  	formatted_backspace ();
        else
  	unformatted_backspace ();






More information about the Gcc-patches mailing list