From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7012 invoked by alias); 3 Apr 2008 08:55:14 -0000 Received: (qmail 6696 invoked by uid 48); 3 Apr 2008 08:54:28 -0000 Date: Thu, 03 Apr 2008 08:55:00 -0000 Subject: [Bug fortran/35810] New: [F2003] Automatic reallocation on assignment to allocatable variables X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus 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: 2008-04/txt/msg00269.txt.bz2 The following is invalid Fortran 95 but valid Fortran 2003 as the variable is reallocated: integer, allocatable :: a(:) allocate(a(1)) print *, size(a) a = [1,2,3] ! Implicit reallocation. ! Wrong: a(:) = [1,2,3] ! Out of bounds 1 vs. 3 print *, size(a) end The Intel compiler already supports this option. It provides the option -assume [no]realloc_lhs to switch the support on/off. "Off" is useful for bound checks and makes the program faster as the bounds do not need to be checked in that case. See also the comp.lang.fortran post at: http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/7d5d1e7f4a48071c/7c63fef65ba5ea70?lnk=gst&q=realloc_lhs -- Summary: [F2003] Automatic reallocation on assignment to allocatable variables Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org OtherBugsDependingO 20585 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35810