public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/39286] New: Missing out-of-bounds diagnostic
Date: Tue, 24 Feb 2009 09:56:00 -0000 [thread overview]
Message-ID: <bug-39286-13404@http.gcc.gnu.org/bugzilla/> (raw)
Found in the thread at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/792d5c732cc84ddf
Post: http://groups.google.com/group/comp.lang.fortran/msg/025a878dd2d9f8e0
I have not checked whether this is indeed an issue.
---------------
[...]
> At line 25 of file jahed_1.f90
> Fortran runtime error: Array bound mismatch for dimension 1 of array
> 'v3'
I wonder if GFortran is misrepresenting the error. The error message
suggests that GFortran is inferring the size of the assignee from the
LHS of the assignment statement on Line-9, rather than from the RHS
expression on the same line. The former has dimension 1:5, the latter
has 1:6. MRC, Sec. 3.11 says "..if the expression includes a reference
to the array variable or to a part of it, the expression is
interpreted as being fully evaluated before the assignment commences".
The extent of the expression is 6; the extent of the lvalue is 5.
Following Oliver Hardy's advice, "let's really make it dirty", I added
to the RHS the term
+ (/(i+2,i=0,n)/)
and added i to the declaration of integers on Line-3. After this
change, GFortran gave this spurious message at compile time
err.f90:9: warning: 'i' may be used uninitialized in this function
and, despite the bounds-check being on, gave no error during execution.
--
Summary: Missing out-of-bounds diagnostic
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 27766
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39286
next reply other threads:[~2009-02-24 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-24 9:56 burnus at gcc dot gnu dot org [this message]
2009-03-08 16:08 ` [Bug fortran/39286] " pault at gcc dot gnu dot org
2009-04-29 14:12 ` dominiq at lps dot ens dot fr
2009-04-29 14:20 ` dominiq at lps dot ens dot fr
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-39286-13404@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).