From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29367 invoked by alias); 1 Nov 2009 20:47:03 -0000 Received: (qmail 29335 invoked by uid 48); 1 Nov 2009 20:46:51 -0000 Date: Sun, 01 Nov 2009 20:47:00 -0000 Message-ID: <20091101204651.29334.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/41872] wrong-code: Issues with allocatable scalars In-Reply-To: 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: 2009-11/txt/msg00028.txt.bz2 ------- Comment #5 from burnus at gcc dot gnu dot org 2009-11-01 20:46 ------- SAVE problem: Simply adding (!sym->attr.save && (... || ...)) to gfc_trans_deferred_vars does not work as one then reaches "unreachable()"; one should check where SAVE is handles for allocatable arrays, which is presumably before gfc_trans_deferred_vars is called. * * * Need to add a test for: integer, allocatable :: a allocate(a) deallocate(a) deallocate(a) ! ERROR end (This works already.) And a test for integer, allocatable :: a allocate(a) allocate(a) ! ERROR end which doesn't work. (If it were, the following would not happen.) There is no default initialization to NULL; thus the following crashes: integer, allocatable :: a if (allocated(a)) call abort() end * * * One needs to also add tests for TYPE (incl. default initializer), for CLASS, and for TYPE/CLASS with allocatable components. (SAVE, optional, intent(out), allocate/deallocate statements, automatic deallocation...) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41872