From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31868 invoked by alias); 2 May 2013 11:44:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31838 invoked by uid 48); 2 May 2013 11:44:45 -0000 From: "burnus at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg00077.txt.bz2 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