public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jv244 at cam dot ac dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/39772]  New: add a correctness check for the size intrinsic to -fbounds-check
Date: Tue, 14 Apr 2009 21:25:00 -0000	[thread overview]
Message-ID: <bug-39772-6642@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2009-04-14 21:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 21:25 jv244 at cam dot ac dot uk [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-39772-6642@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).