g77: auto arrays + goto = no go

David C. Doherty doherty@networkcs.com
Mon Nov 17 10:46:00 GMT 1997


I sent the following to fortran@gnu.ai.mit.edu, and Dave Love
replied that he was able to reproduce it on rs6000-aix; not on
others. He suggested that I send it to egcs-bugs. 

Any ideas would be greatly appreciated. I'd being willing to 
test patches to egcs to squash this.  Thanks.

here's the original msg:
--
Hi - I've observed the following behavior regarding 
automatic arrays and gotos.  Seems similar to what I found
in the docs about computed gotos (but not exactly the same).

I suspect from the nature of the error msg that it's in the GBE.

I'm using egcs-971105, under linux-ppc.

I also observed the same in g77-0.5.19 (and gcc 2.7.2?).

I'd appreciate any advice on this.  thanks for the great work.
--
>cat testg77.f
      subroutine testg77(n, a)
c
      implicit none
c
      integer n
      real a(n)
      real b(n)
      integer i
c
      do i = 1, 10
        if (i .gt. 4) goto 100
        write(0, '(i2)')i
      enddo
c
      goto 200
100   continue
200   continue
c
      return
      end
>g77 -c testg77.f
testg77.f: In subroutine `testg77':
testg77.f:19: label `200' used before containing binding contour
testg77.f:18: label `100' used before containing binding contour
--
If I comment out the b(n) line or replace it with, e.g., b(10),
it compiles fine.

-- 
David C. Doherty
doherty@networkcs.com              612.337.3402
-- 
David C. Doherty
doherty@networkcs.com              612.337.3402



More information about the Gcc-bugs mailing list