From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14466 invoked by alias); 17 Dec 2013 17:36:42 -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 14436 invoked by uid 48); 17 Dec 2013 17:36:39 -0000 From: "bugs at stellardeath dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59537] New: "Automatic array cannot have an initializer", for -finit-real and a SAVE statement present in subroutine Date: Tue, 17 Dec 2013 17:36: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: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bugs at stellardeath dot 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-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: 2013-12/txt/msg01536.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59537 Bug ID: 59537 Summary: "Automatic array cannot have an initializer", for -finit-real and a SAVE statement present in subroutine Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: bugs at stellardeath dot org Created attachment 31461 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31461&action=edit Minimal example code The following valid, minimal example code subroutine foo(n) implicit none integer n real :: a(1:n) save a(1) = 3 end subroutine foo cannot be compiled with -finit-real. The presence of the catch-all SAVE statement seems to affect this, even though it should not apply to the automatic array a (right?): #> gfortran -finit-real=nan -c minimal.f90 minimal.f:4.20: real :: a(1:n) 1 Error: Automatic array 'a' at (1) cannot have an initializer #> Without the SAVE statement it compiles fine. I see this with the installed gfortran 4.8.2 from openSUSE and also with a self-compiled gfortran from today (2013-12-17): #> gfortran --version GNU Fortran (SUSE Linux) 4.8.2 20131210 [gcc-4_8-branch revision 205857] Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING #> ~/sys/stow/gcc-2013-12-17/bin/gfortran --version GNU Fortran (GCC) 4.9.0 20131217 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING