public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/39772] add a correctness check for the size intrinsic to -fbounds-check
Date: Wed, 15 Apr 2009 17:44:00 -0000 [thread overview]
Message-ID: <20090415174350.10916.qmail@sourceware.org> (raw)
In-Reply-To: <bug-39772-6642@http.gcc.gnu.org/bugzilla/>
------- Comment #5 from kargl at gcc dot gnu dot org 2009-04-15 17:43 -------
(In reply to comment #4)
> > But, it does not do
> > what you expected! Try using your allocated array in something
> > other than SIZE().
>
> It's doing exactly what I expect... including the size intrinsic returning a
> garbage result because it returns a default integer.
>
> > cat test.f90
> INTEGER*8 :: N
> INTEGER, DIMENSION(:), ALLOCATABLE :: data
> N=2_8**32
> write(6,*) N
> ALLOCATE(data(N))
> data(1:N)=0
> write(6,*) SIZE(data,1)
> END
> > gfortran -O2 -fbounds-check test.f90
> > ./a.out
> 4294967296
> 0
>
Damn. I was in the wrong xterm, which was a i686 system
not my usual x86_64. I looked at the wrong dump. You're
correct that size is doing something stupid. From the
dump
logical(kind=4) D.1539; <-- This wrong.
integer(kind=8) size.2;
integer(kind=8) D.1537;
data.dtype = 265;
data.dim[0].lbound = 1;
data.dim[0].ubound = n;
data.dim[0].stride = 1;
D.1537 = NON_LVALUE_EXPR <MAX_EXPR <n, 0>>;
D.1539 = NON_LVALUE_EXPR <n> <= 0; <--- because this triggers
if (D.1539) <--- this.
{
size.2 = 0;
}
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-04-15 17:43:49
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39772
next prev parent reply other threads:[~2009-04-15 17:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-14 21:25 [Bug fortran/39772] New: " 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 [this message]
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=20090415174350.10916.qmail@sourceware.org \
--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).