public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59065] New: questionable bounds for unassociated allocatable/pointer arrays?
@ 2013-11-10 10:29 zeccav at gmail dot com
  2013-11-10 16:44 ` [Bug fortran/59065] " kargl at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: zeccav at gmail dot com @ 2013-11-10 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59065
           Summary: questionable bounds for unassociated
                    allocatable/pointer arrays?
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zeccav at gmail dot com

! gfortran produces SIGSEV at run time for access to unassociated
allocatable/pointer arrays
! questionable bounds for unassociated allocatable/pointer arrays?
! such arrays properties are undefined but I suggest lbound be 1, ubound 0,
size 0
! to minimize damage to erroneous code accessing such arrays
! -fcheck=all does not help
! Linux Fedora 19 bash shell 4.2.45-1
      real, pointer :: ap(:)=>null()
      real, allocatable :: aa(:)
      print *,lbound(aa),ubound(aa),size(aa) ! displays "0 garbage garbage"
should be "1 0 0"?
      print *,lbound(ap),ubound(ap),size(ap) ! displays "0 0 1" should be "1 0
0"?
      call sub(aa,ap)
      contains 
      subroutine sub(va,vp)
      real, intent(in) :: vp(:)
      real, intent(in) :: va(:)
      print *,lbound(va),ubound(va),size(va) ! displays "1 garbage garbage"
should be "1 0 0"?
      print *,lbound(vp),ubound(vp),size(vp) ! displays "1 1 1" should be "1 0
0"?
      print *,va(1) ! SIGSEGV here -fcheck=all does not detect it
      print *,vp(1) ! ditto
      end subroutine
      end


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

end of thread, other threads:[~2021-02-21  9:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-10 10:29 [Bug fortran/59065] New: questionable bounds for unassociated allocatable/pointer arrays? zeccav at gmail dot com
2013-11-10 16:44 ` [Bug fortran/59065] " kargl at gcc dot gnu.org
2013-11-10 19:46 ` zeccav at gmail dot com
2013-11-10 19:57 ` sgk at troutmask dot apl.washington.edu
2013-11-10 20:36 ` dominiq at lps dot ens.fr
2013-11-11  9:14 ` zeccav at gmail dot com
2013-11-11 19:10 ` anlauf at gmx dot de
2013-11-12  8:13 ` zeccav at gmail dot com
2013-11-12 14:20 ` sgk at troutmask dot apl.washington.edu
2013-11-12 15:52 ` zeccav at gmail dot com
2021-02-21  7:43 ` zeccav at gmail dot com
2021-02-21  9:41 ` dominiq at lps dot ens.fr

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).