From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19101 invoked by alias); 25 Apr 2009 16:37:18 -0000 Received: (qmail 18898 invoked by uid 48); 25 Apr 2009 16:37:07 -0000 Date: Sat, 25 Apr 2009 16:37:00 -0000 Message-ID: <20090425163707.18897.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/39894] memory corruption with array section assignment of arrays with different shape In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kargl at gcc dot gnu dot org" 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 X-SW-Source: 2009-04/txt/msg02337.txt.bz2 ------- Comment #5 from kargl at gcc dot gnu dot org 2009-04-25 16:37 ------- The Fortran 95 standard states: 7.5.1.4 Intrinsic assignment conformance rules For an intrinsic assignment statement, variable and expr shall conform in shape, and if expr is an array, variable shall also be an array. The types of variable and expr shall conform with the rules of Table 7.9. This is not a constraint, so a compiler is not required to generate a warning or an error. It can do anything, including corrupt memory. As Dominique suggested, one should use the -fbounds-check option while developing code. -- kargl at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39894