This is the mail archive of the gcc-prs@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]

fortran/1636: Format strings with identical numbers cause assembler error



>Number:         1636
>Category:       fortran
>Synopsis:       Format strings with identical numbers cause assembler error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 12 13:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        2.97 20010111 (experimental)
>Organization:
schmid@snake.iap.physik.tu-darmstadt.de 
>Environment:
System: Linux kiste 2.4.0-test12 #22 Sun Dec 17 17:24:36 CET 2000 i686 unknown
Architecture: i686
Suse-6.4
glibc-2.1.3
GNU binutils version 2.10.91 (with BFD 2.10.1.0.4)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls
>Description:
Compiling the source file taus.f, causes the assembler to stop with a
"Symbol __g77_format_99w already defined" error. This is probably
because there are two format strings with the label 99. I do not know
if this legal code. But I have employed this feature for years and no
f77 compiler had problems digesting this code. It is the first g77
compiler snapshot that does not compile two format strings with the
same number but in different function bodies into working assembler
code. 

Even if this is illegal code, the compiler should emit a message, and
stop the compilation and not defer the check to the assembler.  
>How-To-Repeat:
cat taus.f
      program ray 
      implicit none
      real*8 Y(2)

      y(1) = 1.d0
      y(2) = 2.d0

      WRITE (6,99) Y(1),Y(2)
 99   FORMAT(1X,'X = XEND     Y =',2E18.10)
      call solout
      STOP
      END
      
      SUBROUTINE solout 
      implicit none
      real*8  Y(2),X
      integer N

      X=6.d0
      y(1) = 3.d0
      y(2) = 4.d0
      N = 1
      WRITE (6,99) X,Y(1),Y(2),N

 99   FORMAT(1X,'X =',F6.2,'    Y =',2E18.10,'    N =',I4)
      RETURN
      END

g77 -v -W -Wall taus.f
g77 version 2.97 20010111 (experimental) (Fortran Frontend version 0.5.26 20010111 (experimental))
Driving: g77 -v -W -Wall taus.f -lg2c -lm
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --enable-shared --disable-nls
gcc version 2.97 20010111 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/f771 taus.f -quiet -dumpbase taus.f -W -Wall -version -o /tmp/cce7yXHq.s
GNU F77 version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.97 20010111 (experimental).
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccMx1KCU.o /tmp/cce7yXHq.s
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
/tmp/cce7yXHq.s: Assembler messages:
/tmp/cce7yXHq.s:76: Fatal error: Symbol __g77_format_99w already defined.

	
>Fix:
Remove the duplicate label numbers
>Release-Note:
>Audit-Trail:
>Unformatted:

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