[Bug fortran/19760] New: wrong results or crash from PURE function

vivekrao4 at yahoo dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 2 15:57:00 GMT 2005

program xx
implicit none
real :: x(1)
x = f((/1.0/))
! commenting the above 3 lines and uncommenting the next causes a crash
! write (*,*) f((/4.0/))
pure function f(xx) result(xsum)
real, intent(in) :: xx(:)
real             :: xsum(size(xx))
xsum = 1.0
end function f
end program xx

gfortran -o xpure_bug.exe -v --free-form -Wall xpure_bug.f  
Driving: gfortran -o xpure_bug.exe -v -ffree-form -Wall xpure_bug.f -
lgfortranbegin -lgfortran
Using built-in specs.
Configured with: ../gcc/configure --prefix=/mingw --enable-languages=c,f95
Thread model: win32
gcc version 4.0.0 20050120 (experimental)
xpure_bug.f -quiet -dumpbase xpure_bug.f -mtune=pentiumpro -auxbase xpure_bug -
Wall -version -ffree-form -o C:\DOCUME~1\rao\LOCALS~1\Temp/ccaWaaaa.s
GNU F95 version 4.0.0 20050120 (experimental) (i686-pc-mingw32)
	compiled by GNU C version 4.0.0 20050117 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
 as -o C:\DOCUME~1\rao\LOCALS~1\Temp/ccaIbaaa.o C:\DOCUME~1\rao\LOCALS~1
 ld -Bdynamic -o xpure_bug.exe c:/programs/gfortran/bin/../lib/gcc/i686-pc-
mingw32/4.0.0/../../../crt2.o -Lc:/programs/gfortran/bin/../lib/gcc/i686-pc-
mingw32/4.0.0 -Lc:/programs/gfortran/bin/../lib/gcc -
Lc:/programs/gfortran/bin/../lib/gcc/i686-pc-mingw32/4.0.0/../../.. C:\DOCUME~1
\rao\LOCALS~1\Temp/ccaIbaaa.o -lgfortranbegin -lgfortran -lmingw32 -lgcc -
lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -
lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt

running xpure_bug.exe

           Summary: wrong results or crash from PURE function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


More information about the Gcc-bugs mailing list