public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18899] New: gfortran/libfortran(?): ubound wrongly calculated for passed array
@ 2004-12-09 8:50 anlauf at hep dot tu-darmstadt dot de
2004-12-19 15:16 ` [Bug fortran/18899] [gfortran] " steven at gcc dot gnu dot org
2005-03-20 15:00 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: anlauf at hep dot tu-darmstadt dot de @ 2004-12-09 8:50 UTC (permalink / raw)
To: gcc-bugs
Hi,
the following code snippet shows that gfortran calculates
the upper bound wrong when the lower bound is not 1.
(If this a bug in libfortran, please adjust the subject.)
module gfcbug22
implicit none
contains
subroutine foo (a)
integer :: a(0:)
if (lbound (a, dim=1) /= 0 .or. ubound (a, dim=1) /= 1) then
print *, "Fail!"
print '(1x,a,i2,a,i2)', &
"lbound =", lbound (a, dim=1), ", ubound =", ubound (a, dim=1)
end if
end subroutine foo
end module gfcbug22
program gfctest22
use gfcbug22
implicit none
integer :: a(0:1)
! It is apparently ok here...
! print '(1x,a,i2,a,i2)', &
! "lbound =", lbound (a, dim=1), ", ubound =", ubound (a, dim=1)
call foo (a)
end program gfctest22
Compiling & running, I get:
Fail!
lbound = 0, ubound = 2
Cheers,
-ha
--
Summary: gfortran/libfortran(?): ubound wrongly calculated for
passed array
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anlauf at hep dot tu-darmstadt dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18899
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/18899] [gfortran] ubound wrongly calculated for passed array
2004-12-09 8:50 [Bug fortran/18899] New: gfortran/libfortran(?): ubound wrongly calculated for passed array anlauf at hep dot tu-darmstadt dot de
@ 2004-12-19 15:16 ` steven at gcc dot gnu dot org
2005-03-20 15:00 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-12-19 15:16 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2004-12-19 15:16:31
date| |
Summary|gfortran/libfortran(?): |[gfortran] ubound wrongly
|ubound wrongly calculated |calculated for passed array
|for passed array |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18899
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/18899] [gfortran] ubound wrongly calculated for passed array
2004-12-09 8:50 [Bug fortran/18899] New: gfortran/libfortran(?): ubound wrongly calculated for passed array anlauf at hep dot tu-darmstadt dot de
2004-12-19 15:16 ` [Bug fortran/18899] [gfortran] " steven at gcc dot gnu dot org
@ 2005-03-20 15:00 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-20 15:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-20 15:00 -------
I get this now:
Fail!
lbound = 1, ubound = 2
Which is only partly more correct but still wrong.
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2004-12-19 15:16:31 |2005-03-20 15:00:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18899
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-20 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-09 8:50 [Bug fortran/18899] New: gfortran/libfortran(?): ubound wrongly calculated for passed array anlauf at hep dot tu-darmstadt dot de
2004-12-19 15:16 ` [Bug fortran/18899] [gfortran] " steven at gcc dot gnu dot org
2005-03-20 15:00 ` pinskia 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).