public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27980]  New: Wrong allocation for zero-sized function result
@ 2006-06-09 17:47 tkoenig at gcc dot gnu dot org
  2006-06-09 18:30 ` [Bug fortran/27980] " tkoenig at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2006-06-09 17:47 UTC (permalink / raw)
  To: gcc-bugs

>From a posting to comp.lang.fortran:

program xint_func
  implicit none
  integer, parameter :: n=3,ii(n)=(/2,0,-1/)
  integer            :: i
  character(len=80)  :: line
  do i=1,n
     write (line,'(10I5)'), int_func(ii(i))
  end do
contains
  function int_func(n) result(ivec)
    integer, intent(in) :: n
    integer             :: ivec(n)
    integer             :: i
    if (n > 0) then
       forall (i=1:n) ivec(i) = i
    end if
  end function int_func
end program xint_func
$ gfortran foo.f90
$ ./a.out
Fortran runtime error: Attempt to allocate a negative amount of memory.
$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../gcc/trunk/configure --prefix=/home/ig25
--enable-languages=c,fortran
Thread model: posix
gcc version 4.2.0 20060525 (experimental)

I'm looking into this.


-- 
           Summary: Wrong allocation for zero-sized function result
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

end of thread, other threads:[~2006-07-16 10:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-09 17:47 [Bug fortran/27980] New: Wrong allocation for zero-sized function result tkoenig at gcc dot gnu dot org
2006-06-09 18:30 ` [Bug fortran/27980] " tkoenig at gcc dot gnu dot org
2006-06-12 22:04 ` tkoenig at gcc dot gnu dot org
2006-06-12 23:00 ` kargl at gcc dot gnu dot org
2006-06-13 19:15 ` patchapp at dberlin dot org
2006-06-19 22:42 ` [Bug fortran/27980] [4.1 only] " fxcoudert at gcc dot gnu dot org
2006-06-19 23:07 ` fxcoudert at gcc dot gnu dot org
2006-07-15 21:47 ` tkoenig at gcc dot gnu dot org
2006-07-16 10:12 ` tkoenig at gcc dot gnu dot org
2006-07-16 10:12 ` tkoenig 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).