From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7384 invoked by alias); 13 Jan 2014 21:53:15 -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 7369 invoked by uid 48); 13 Jan 2014 21:53:10 -0000 From: "w6ws at earthlink dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59796] New: Deallocate aborts even with STAT= Date: Mon, 13 Jan 2014 21:53: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-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: w6ws at earthlink dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01404.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59796 Bug ID: 59796 Summary: Deallocate aborts even with STAT=3D Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: w6ws at earthlink dot net Yes, this is probably a duplicate of the now-closed bug 44504. The following code returns a stat of 0 from g95, PGI (v13.8), and NAG (v5.3= .1). However Intel and gfortran abend - which is not very friendly. Who is rig= ht? program double_dealloc implicit none integer, pointer :: ip1(:), ip2(:) integer :: memstat allocate (ip1(42)) ip2 =3D> ip1 deallocate (ip1) deallocate (ip2, stat=3Dmemstat) print *, 'memstat =3D', memstat end program The Fortran 2008 Standard, in section 6.7.4 pertaining to the STAT=3D speci= fier, starts off somewhat vague with respect to STAT=3D when there is an error. = In paragraph 2 it only states that upon success, a value of 0 is set. However in paragraph 3, which pertains to co-array allocation, it does explicitly state that "... If any other error condition occurs during execution of the ALLOCATE or DEALLOCATE statement, the stat-variable become= s de ned with a processor-dependent positive integer value di=0Bfferent from STAT STOPPED IMAGE. In either case, each allocate-object has a processor-dependent status..." Also in the following Note 6.25, it states "The status of objects that were= not successfully allocated or deallocated can be individually checked with the intrinsic functions ALLOCATED or ASSOCIATED." >>From these last two sets of statements, it seems clear that the intent of = the Standard is that no deallocation should cause an abend when stat=3D is pres= ent. >>From gcc-bugs-return-440263-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jan 13 22:05:46 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 13648 invoked by alias); 13 Jan 2014 22:05:46 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 13624 invoked by uid 48); 13 Jan 2014 22:05:42 -0000 From: "w6ws at earthlink dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59796] Deallocate aborts even with STAT= Date: Mon, 13 Jan 2014 22:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: w6ws at earthlink dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01405.txt.bz2 Content-length: 194 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59796 --- Comment #1 from Walter Spector --- Forgot to mention: The test case was tested with gfortran 4.7.3 and 4.8.2.