public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dick dot hendrickson at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35990]  New: run-time abort for MATMUL of run-time zero sized array
Date: Sun, 20 Apr 2008 19:28:00 -0000	[thread overview]
Message-ID: <bug-35990-15620@http.gcc.gnu.org/bugzilla/> (raw)

Two of the following 4 subroutines abort at run time.  They
have a zero sized array argument to PACK.  If the left and
right hand zero sizes are "the same", it works.  Also works if
the zero size is a compile time thing.

Dick Hendrickson

      program try_gf1048

! fails on Windows XP
! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139]

      call       gf1048a(  10,  8,  7,  1,  0,  .true.)
      call       gf1048b(  10,  8,  7,  1,  0,  .true.)
      call       gf1048c(  10,  8,  7,  1,  0,  .true.)    !fails
      call       gf1048d(  10,  8,  7,  1,  0,  .true.)    !fails
      end program

      SUBROUTINE GF1048a(nf10,nf8,nf7,nf1,nf0,nf_true)
      logical nf_true
      CHARACTER(9) BDA(10)
      CHARACTER(9) BDA1(10)
      print *, 'gf1048a started'
      BDA(  8:7) = PACK(BDA1( 10:  1), NF_TRUE)
      print *, 'gf1048a finished'
      END SUBROUTINE

      SUBROUTINE GF1048b(nf10,nf8,nf7,nf1,nf0,nf_true)
      logical nf_true
      CHARACTER(9) BDA(10)
      CHARACTER(9) BDA1(nf10)
      print *, 'gf1048b started'
      BDA(NF8:NF7) = PACK(BDA1(NF8:NF7), NF_TRUE)
      print *, 'gf1048b finished'
      END SUBROUTINE

      SUBROUTINE GF1048c(nf10,nf8,nf7,nf1,nf0,nf_true)
!  on windows XP, natters to itself a while and then goes
!  back to command line prompt with no obvious message
      logical nf_true
      CHARACTER(9) BDA(10)
      CHARACTER(9) BDA1(10)
      print *, 'gf1048c started'
      BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
      print *, 'gf1048c finished'
      END SUBROUTINE

      SUBROUTINE GF1048d(nf10,nf8,nf7,nf1,nf0,nf_true)
!  on windows XP, natters to itself a while and then opens
!  a run time error box and offers to send report to MS
      logical nf_true
      CHARACTER(9) BDA(10)
      CHARACTER(9) BDA1(nf10)
      print *, 'gf1048d started'
      BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
      print *, 'gf1048d finished'
      END SUBROUTINE

C:\gfortran:gfortran gf1048.f

C:\gfortran:a
 gf1048a started
 gf1048a finished
 gf1048b started
 gf1048b finished
 gf1048c started

C:\gfortran:gfortran gf1048.f

!  call gf1048c commented out
C:\gfortran:a
 gf1048a started
 gf1048a finished
 gf1048b started
 gf1048b finished
 gf1048d started

C:\gfortran:


-- 
           Summary: run-time abort for MATMUL of run-time zero sized array
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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


             reply	other threads:[~2008-04-20 19:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-20 19:28 dick dot hendrickson at gmail dot com [this message]
2008-04-20 19:40 ` [Bug fortran/35990] run-time abort for PACK " burnus at gcc dot gnu dot org
2008-04-23  5:58 ` tkoenig at gcc dot gnu dot org
2008-04-23 20:33 ` tkoenig at gcc dot gnu dot org
2008-05-03 21:09 ` tkoenig at gcc dot gnu dot org
2008-05-04  8:07 ` tkoenig at gcc dot gnu dot org
2008-05-04  9:04 ` tkoenig at gcc dot gnu dot org
2008-05-04 10:00 ` dominiq at lps dot ens dot fr
2008-05-04 10:16 ` tkoenig at netcologne dot de
2008-05-04 10:16 ` tkoenig at gcc dot gnu dot org
2008-05-06 20:48 ` tkoenig at gcc dot gnu dot org
2008-05-06 20:50 ` tkoenig 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-35990-15620@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).