public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59104] New: Wrong result with SIZE specification expression
@ 2013-11-13  7:33 burnus at gcc dot gnu.org
  2013-12-19 11:31 ` [Bug fortran/59104] " dominiq at lps dot ens.fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-11-13  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59104
           Summary: Wrong result with SIZE specification expression
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

James Van Buskirk found the following problem,
https://groups.google.com/forum/#!topic/comp.lang.fortran/2RleGXz6-ew

Result with GCC 4.8 + 4.9:
   size(f) =            1
   size(y) =   2143476561

Result with GCC 4.5, 4.6 and 4.7:
 size(f) =            1
 size(y) =            1

Expected result:
 size(f) =            1
 size(y) =            2


module m1
   implicit none
   integer, parameter :: dp = kind([double precision::])
   contains
      recursive function f(x)
         integer, intent(in) :: x
         real(dp) f(x/2)
         integer y(size(f)+1)

         write(*,*) 'size(f) = ',size(f)
         write(*,*) 'size(y) = ',size(y)
         f = 0
      end function f
end module m1

program bug3
   use m1
   implicit none
   real y

   y = sum(f(2))
end program bug3


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

end of thread, other threads:[~2024-06-20  7:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13  7:33 [Bug fortran/59104] New: Wrong result with SIZE specification expression burnus at gcc dot gnu.org
2013-12-19 11:31 ` [Bug fortran/59104] " dominiq at lps dot ens.fr
2015-08-18  8:15 ` fxcoudert at gcc dot gnu.org
2022-01-24 21:57 ` anlauf at gcc dot gnu.org
2024-05-22  7:46 ` pault at gcc dot gnu.org
2024-05-23  5:30 ` pault at gcc dot gnu.org
2024-06-04 21:51 ` pault at gcc dot gnu.org
2024-06-20  7:01 ` cvs-commit at gcc dot gnu.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).