egcs1.0.1/g77 array dimension problem

Clemens Vonrhein vonrhein@chemie.uni-freiburg.de
Mon Feb 2 04:26:00 GMT 1998


Is it possible, that egcs1.0.1/g77 can not handle arrays with negative
array boundaries? I allways get a core dump in the write statement
after writing the first element:

#0  l_write (number=0x12000b61c, ptr=0x1ffffffd1fffe84c <Address
 0x1ffffffd1fffe84c out of bounds>, len=4, type=3)
    at /alpha1/src/egcs-1.0/gcc/f/runtime/libI77/lwrite.c:271
#1  0x120001bb0 in do_lio (type=0x12000b61c,
 number=0x1ffffffd1fffe84c, ptr=0x4 <Address 0x4 out of bounds>, len=3)
    at /alpha1/src/egcs-1.0/gcc/f/runtime/libI77/dolio.c:16
#2  0x120001544 in testsr_ (i1=0x12000b610, i2=0x12000b614,
 j1=0x12000b610, j2=0x12000b614, map=0x11fffe7f8) at /tmp/test.f:34
#3  0x120001380 in MAIN__ () at /tmp/test.f:20
#4  0x12000181c in main (argc=536917532, argv=0x1ffffffd1fffe84c) at /alpha1/src/egcs-1.0/gcc/f/runtime/libF77/main.c:128

egcs1.0.1 was built on RedHat 5.0 (alpha).

      program test
      implicit none
      integer i,map(441)
      do 100 i=1,441
        map(i)=i
 100  continue
      call testsr(-10,10,-10,10,map)
      return
      end
c
      subroutine testsr(i1,i2,j1,j2,map)
      implicit none
      integer i1,i2,j1,j2,ii,jj
      integer map(i1:i2,j1:j2)
      do 100 ii=i1,i2
        do 100 jj=j1,j2
          write(6,'(i4)') map(ii,jj)
 100  continue
      return
      end

-- 

***************************************************************************
* Clemens Vonrhein   email vonrhein@bio5.chemie.uni-freiburg.de           *
*                    WWW   http://bio5.chemie.uni-freiburg.de/~vonrhein/  *
*                                                                         *
*         Institut f. Org. Chemie u. Biochemie                            *
*         Albertstr.21                                                    *
* D-79104 Freiburg i.Br. (Germany)                                        *
*  Tel.: 761/203-6061   FAX: 761/203-6161                                 *
***************************************************************************



More information about the Gcc-bugs mailing list