public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57142] New: SIZE/SHAPE overflow despite kind=8
Date: Thu, 02 May 2013 11:44:00 -0000	[thread overview]
Message-ID: <bug-57142-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 57142
           Summary: SIZE/SHAPE overflow despite kind=8
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic, wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following program should print:
  1 k=8 / 4294967300 k=8
  1 k=8 / 2147483650 k=8

However, it prints:
  1 k=8 / 4 k=8
  1 k=8 / -2147483646 k=8

Expected:
* kind=8 is properly handled
* With kind=4, a warning/error is printed that the value exceeds huge(1_4)

NOTE: shape has the same issue; ubound/lbound are okay (in both regards). The
run-time version is fine.


!integer :: A(huge(1)+2_8), B(2,3)
integer :: A(1), B(huge(1)+3_8,2_8)
print '(4(i0,a))', size(A,kind=8),' k=', kind(size(A,kind=8)),' / ', &
                   size(B,kind=8),' k=', kind(size(B,kind=8))
print '(4(i0,a))', size(A,dim=1,kind=8),' k=', kind(size(A,dim=1,kind=8)), &
      ' / ',       size(B,dim=1,kind=8),' k=', kind(size(B,dim=1,kind=8))
end


             reply	other threads:[~2013-05-02 11:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 11:44 burnus at gcc dot gnu.org [this message]
2013-05-02 11:53 ` [Bug fortran/57142] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
2013-05-02 12:58 ` dominiq at lps dot ens.fr
2013-05-02 16:30 ` burnus at gcc dot gnu.org
2013-05-07 17:26 ` burnus at gcc dot gnu.org
2013-05-07 17:28 ` burnus at gcc dot gnu.org
2013-05-07 17:29 ` burnus at gcc dot gnu.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-57142-4@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).