public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/30802] out of bounds error array I/O not picked up with -fbounds-check
Date: Wed, 28 Oct 2020 20:27:05 +0000 [thread overview]
Message-ID: <bug-30802-4-WlypZHF7pj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-30802-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=97039
--- Comment #9 from anlauf at gcc dot gnu.org ---
(In reply to markeggleston from comment #8)
> Changing to allocated arrays and bounds checking does not work at compile
> time but does at runtime:
>
> program test
> real, allocatable :: x(:)
> allocate(x(10))
> x = 0.0
> print *, x(0)
> deallocate(x)
> end program test
>
> $ gfortran -fbounds-check pr30802.f90
> $ ./a.out
>
> At line 5 of file pr30802.f90
> Fortran runtime error: Index '0' of dimension 1 of array 'x' below lower
> bound of 1
>
> Error termination. Backtrace:
> #0 0x400ea1 in ???
> #1 0x400f6d in ???
> #2 0x4380b2 in ???
> #3 0x438471 in ???
> #4 0x400c69 in ???
I think the point is that bounds-checking does not work for sections of rank-2
arrays. See also PR97039.
This is not I/O specific, but what Thomas said in comment#3.
next parent reply other threads:[~2020-10-28 20:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-30802-4@http.gcc.gnu.org/bugzilla/>
2020-10-28 20:27 ` anlauf at gcc dot gnu.org [this message]
2023-09-14 19:44 ` anlauf at gcc dot gnu.org
2023-09-14 20:23 ` anlauf at gcc dot gnu.org
2023-09-15 17:14 ` cvs-commit at gcc dot gnu.org
2023-09-15 18:21 ` anlauf at gcc dot gnu.org
2023-09-15 19:06 ` anlauf at gcc dot gnu.org
2024-03-21 17:56 ` cvs-commit at gcc dot gnu.org
2007-02-15 0:28 [Bug fortran/30802] New: out of bounds error in allocatable array " glv at maths dot otago dot ac dot nz
2007-12-08 18:07 ` [Bug fortran/30802] out of bounds error array I/O " fxcoudert at gcc dot gnu dot org
2007-12-17 22:23 ` tkoenig at gcc dot gnu dot org
2010-04-18 15:31 ` jvdelisle 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-30802-4-WlypZHF7pj@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).