public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34546]  New: Incorrect array identified in out of bounds runtime error
@ 2007-12-21  8:35 terry at chem dot gu dot se
  2007-12-21 10:11 ` [Bug fortran/34546] " dfranke at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: terry at chem dot gu dot se @ 2007-12-21  8:35 UTC (permalink / raw)
  To: gcc-bugs

I think this one's a bit bizarre.  (But then again, which bugs aren't?  ;-)


$ cat is
isotope*      isotope.f90   
[tjf@fkpc167 Bug9]$ cat isotope.f90 
program fred
implicit none
integer,parameter::NoJmax=6000
integer,parameter::MaxTotalJ=100
integer,parameter::ER=14513
real,parameter::EnergyFactor=1.5
real(kind=8),dimension(ER:nint(EnergyFactor*ER),6)::pT
real(kind=8),dimension(0:MaxTotalJ,0:NoJmax,6)::JTEJ
integer::JJ,E

JTEJ=1
pT=2

write(*,*)ER

JJ=0
E=2000

write(*,*)size(JTEJ(JJ,E,:))
write(*,*)size(pT(E,:))

write(10,*)JJ,E,real(JTEJ(JJ,E,:))
write(10,*)JJ,E,real(JTEJ(JJ,E,:)*pT(E,:))

end

$ gfortran --version
GNU Fortran (GCC) 4.3.0 20071109 (experimental)
Copyright (C) 2007 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

$ gfortran -Wall -W -Wtabs -g -fbounds-check -O -o isotope isotope.f90
$ ./isotope 
       14513
           6
           6
At line 23 of file isotope.f90
Fortran runtime error: Array reference out of bounds for array 'jtej', lower
bound of dimension 1 exceeded(2000 < 14513)


Yes, it's bad code.  But what's with the bounds of pT being projected onto
JTEJ?

(Of course, apologies if it's been fixed since November!)


-- 
           Summary: Incorrect array identified in out of bounds runtime
                    error
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terry at chem dot gu dot se
  GCC host triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2010-04-16 16:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-21  8:35 [Bug fortran/34546] New: Incorrect array identified in out of bounds runtime error terry at chem dot gu dot se
2007-12-21 10:11 ` [Bug fortran/34546] " dfranke at gcc dot gnu dot org
2008-07-02  2:11 ` terry at chem dot gu dot se
2008-07-02  5:07 ` jvdelisle at gcc dot gnu dot org
2008-07-02  5:12 ` terry at chem dot gu dot se
2009-03-29  7:44 ` fxcoudert at gcc dot gnu dot org
2009-12-11 22:20 ` dfranke at gcc dot gnu dot org
2010-04-16 16:39 ` kargl at gcc dot gnu dot org
2010-04-16 16:39 ` kargl 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).