From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14878 invoked by alias); 2 Sep 2015 21:51:21 -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 14835 invoked by uid 48); 2 Sep 2015 21:51:17 -0000 From: "anlauf at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67430] reallocate lhs with overloaded assignment operators causes memory error and wrong size Date: Wed, 02 Sep 2015 21:51: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: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gmx dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: cc 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: 2015-09/txt/msg00212.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67430 Harald Anlauf changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #3 from Harald Anlauf --- (In reply to Andrew Baldwin from comment #2) > In 7.2.1.4 of my copy of the standard it states: > > "A subroutine defines the defined assignment x1 = x2 if" > > ... > > "(5) either > (a) the ranks of x1 and x2 match those of d1 and d2 or > (b) the subroutine is elemental, x1 and x2 are conformable, and there is > no other subroutine that defines the assignment." It also says: "If d1 or d2 is an array, the shapes of x1 and x2 shall match the shapes of d1 and d2 , respectively." This is not the case for your example. (NAG and Crayftn also do not reallocation.) > Since x1 and x2 are not conformable in this instance the defined assignment > (overloaded assignment) my reading is that it should not occur. I'm no standard expert, but (5)(a) appears to be satisfied, so the non-conformance of x1 and x2 does not matter. To be sure, consider posting your question on comp.lang.fortran.