This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch, testsuite/gfortran.dg committed] Fix non-initialized variables in test cases


Hello world,

the attached patch fixes some uninitialized variables in test
cases, which were caught by valgrind.

Committed as obvious.

There is still one other issue in the PR, which I am still looking at
(writing REAL(KIND=10) with CONVERT="SWAP").

	Thomas

2007-03-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR libfortran/31297
        * gfortran.dg/backspace_5.f:  Initialize variable(s).
        * gfortran.dg/backspace_6.f:  Likewise.
        * gfortran.dg/char_bounds_check_fail_1: Likewise.
        * gfortran.dg/direct_io_2.f90:  Likewise.
        * gfortran.dg/write_back.f:  Likewise.
        * gfortran.dg/write_rewind_2.f:  Likewise.
        * gfortran.dg/write_rewind_1.f:  Likewise.
        * gfortran.dg/write_rewind_2.f:  Likewise.


Index: gfortran.dg/backspace_5.f
===================================================================
--- gfortran.dg/backspace_5.f	(revision 123028)
+++ gfortran.dg/backspace_5.f	(working copy)
@@ -5,6 +5,7 @@
       program test
       integer,parameter :: datasize = 1000
       dimension idata(datasize)
+      idata = -42
       open (11, status="scratch", form="unformatted")
         idata(1)   =  -1
         idata(  datasize)   =  -2
@@ -31,4 +32,4 @@
        call abort()
  1010  stop
        end
-       
\ No newline at end of file
+
Index: gfortran.dg/write_rewind_1.f
===================================================================
--- gfortran.dg/write_rewind_1.f	(revision 123028)
+++ gfortran.dg/write_rewind_1.f	(working copy)
@@ -4,6 +4,7 @@
 ! Submitted by Jerry DeLisle <jvdelisle@verizon.net>.
       program test
       dimension idata(100)
+      idata = -42
       open(unit=11,form='unformatted')
       write(11)idata
       write(11)idata
Index: gfortran.dg/backspace_6.f
===================================================================
--- gfortran.dg/backspace_6.f	(revision 123028)
+++ gfortran.dg/backspace_6.f	(working copy)
@@ -5,6 +5,7 @@
       program test
       integer,parameter :: datasize = 5000
       dimension idata(datasize)
+      idata = -42
       open (11, status="scratch", form="unformatted")
         idata(1)   =  -1
         idata(datasize)   =  -2
Index: gfortran.dg/char_bounds_check_fail_1.f90
===================================================================
--- gfortran.dg/char_bounds_check_fail_1.f90	(revision 123028)
+++ gfortran.dg/char_bounds_check_fail_1.f90	(working copy)
@@ -6,6 +6,7 @@ program bound_check
       character*10 zz
       i = 2
       j = i+9
+      zz = ' '
       zz(i:j) = 'abcdef'
       print * , zz
       end
Index: gfortran.dg/direct_io_2.f90
===================================================================
--- gfortran.dg/direct_io_2.f90	(revision 123028)
+++ gfortran.dg/direct_io_2.f90	(working copy)
@@ -6,6 +6,7 @@
       PROGRAM FM413
       IMPLICIT LOGICAL (L)
       IMPLICIT CHARACTER*14 (C)
+      DATA IPROG, IFILE, ITOTR, IRLGN, IRECN, IEOF,ICON21, ICON22, ICON31, ICON32, ICON33, ICON34, ICON55, ICON56 /14*0/
       OPEN (7, ACCESS = 'DIRECT', RECL = 80, STATUS='REPLACE', FILE="FOO" )
       IRECN = 13
       IREC = 13
Index: gfortran.dg/write_rewind_2.f
===================================================================
--- gfortran.dg/write_rewind_2.f	(revision 123028)
+++ gfortran.dg/write_rewind_2.f	(working copy)
@@ -4,6 +4,7 @@
 ! Ranta.  Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
       program test
       dimension idata(1011)
+      idata = -42
       open(unit=11,form='unformatted')
         idata(1)   = -705
         idata(  1011)   = -706
Index: gfortran.dg/write_back.f
===================================================================
--- gfortran.dg/write_back.f	(revision 123028)
+++ gfortran.dg/write_back.f	(working copy)
@@ -5,6 +5,7 @@
       program test
       integer at,eof
       dimension idata(5)
+      idata = -42
       open(unit=11,form='unformatted')
       write(11)idata
       write(11)idata

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]