public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31921]  New: crash for FUNCTION with RESULT specifier
@ 2007-05-14 18:01 beliavsky at aol dot com
  2007-05-14 18:14 ` [Bug fortran/31921] " dominiq at lps dot ens dot fr
  2007-05-14 19:08 ` burnus at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: beliavsky at aol dot com @ 2007-05-14 18:01 UTC (permalink / raw)
  To: gcc-bugs

module mman 
implicit none
private 
public mskew,nskew
contains 
function nskew() result(y)
real :: y(1)
call skewm(y)
end function nskew
!
function mskew() 
real :: mskew(1) 
call skewm(mskew)
end function mskew
!
subroutine skewm(smat) 
real, intent(out) :: smat(1) 
smat = 0.0
end subroutine skewm
end module mman
!
program mtst 
use mman, only: mskew,nskew
implicit none 
print*,"(1) calling nskew"
print*,nskew()
print*,"(2) calling mskew"
print*,mskew()
print*,"(3) done"
end program mtst

Compiling with mingw gfortran 20070506 with the default options gives the
incorrect warning message

xfunc_bug.f90: In function 'mskew':
xfunc_bug.f90:13: warning: Function does not return a value

and at run time the output is

 (1) calling nskew
   0.000000    
 (2) calling mskew
<crash>


-- 
           Summary: crash for FUNCTION with RESULT specifier
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: beliavsky at aol dot com


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-14 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-14 18:01 [Bug fortran/31921] New: crash for FUNCTION with RESULT specifier beliavsky at aol dot com
2007-05-14 18:14 ` [Bug fortran/31921] " dominiq at lps dot ens dot fr
2007-05-14 19:08 ` burnus at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).