help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug fortran/14514] New: -ffortran-bounds-check generate wrong-code with


From: cgerdy at wanadoo dot fr
Subject: [Bug fortran/14514] New: -ffortran-bounds-check generate wrong-code with Windows and works correctly with Linux
Date: 10 Mar 2004 16:31:03 -0000

g77 -v = Thread model : win32 gcc version 3.3.1 (mingw special 20030804-1)
This short example has the bug :

subroutine fichbuf(fichier,fichhlp,buffer,numero,numerp,lligne,
     *nprio,nomlig,iundo,mligne,nomlih)
      parameter(nligne = 85)
      parameter(n2 = 72,m1 = n2 + 9)
      character buffer(0:m1,0:nligne)
      character*(m1) fichier(mligne)
      save
      mumero = numero
      do 100 i = 2,nomlig
         do j = 1,m1
            buffer(j,i) = fichier(mumero)(j:j)    ! the bug is in this line
         end do
         mumero = mumero + 1
 100 continue
      return
      end

In your Makefile put the line :

test.o:test.f
    g77 -ffortran-bounds-check -g -Wa,-alhs,-L -c test.f

In a DOS window, go to the correct directory and tape :

make test.o > test.asm

examine carefully the code line : buffer(j,i) = fichier(mumero)(j:j)
in the file test.asm and read the generated assembler lines in Windows and
in Linux
a big difference : approximately 20 lines of assembler code are suppressed
in Windows
The assembler lines of windows cannot work and automatically generate a
segmentation fault if you execute this code
There is only 3 call _s_rnge to test 2 arrays with 2 indice each.

-- 
           Summary: -ffortran-bounds-check generate wrong-code with Windows
                    and works correctly with Linux
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cgerdy at wanadoo dot fr
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14514




reply via email to

[Prev in Thread] Current Thread [Next in Thread]