public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39772]  New: add a correctness check for the size intrinsic to -fbounds-check
@ 2009-04-14 21:25 jv244 at cam dot ac dot uk
  2009-04-14 21:26 ` [Bug fortran/39772] " jv244 at cam dot ac dot uk
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-04-14 21:25 UTC (permalink / raw)
  To: gcc-bugs

the following program

INTEGER*8 :: N
INTEGER, DIMENSION(:), ALLOCATABLE :: data
N=2_8**32
write(6,*) N
ALLOCATE(data(N))
write(6,*) SIZE(data,1)
END

prints 

           4294967296
           0

It would be useful if a check for overflow of size could be added to e.g.
-fbounds-check (a rather natural place I would say) so that this kind of
undefined behavior could be detected at run time. I'm aware of the fact that
this is fixed more fundamentally with F2003.


-- 
           Summary: add a correctness check for the size intrinsic to -
                    fbounds-check
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

end of thread, other threads:[~2009-05-04 20:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-14 21:25 [Bug fortran/39772] New: add a correctness check for the size intrinsic to -fbounds-check jv244 at cam dot ac dot uk
2009-04-14 21:26 ` [Bug fortran/39772] " jv244 at cam dot ac dot uk
2009-04-15 12:30 ` dfranke at gcc dot gnu dot org
2009-04-15 13:22 ` jv244 at cam dot ac dot uk
2009-04-15 13:57 ` kargl at gcc dot gnu dot org
2009-04-15 17:04 ` jv244 at cam dot ac dot uk
2009-04-15 17:44 ` kargl at gcc dot gnu dot org
2009-04-16 17:32 ` [Bug fortran/39772] SIZE intrinsic ignores optional KIND argument kargl at gcc dot gnu dot org
2009-04-16 17:34 ` kargl at gcc dot gnu dot org
2009-04-16 17:38 ` jv244 at cam dot ac dot uk
2009-04-16 19:27 ` [Bug fortran/39772] add a correctness check for the size intrinsic to -fbounds-check kargl at gcc dot gnu dot org
2009-05-04 20:24 ` mikael 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).