From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16203 invoked by alias); 5 Nov 2012 17:45:45 -0000 Received: (qmail 16124 invoked by uid 48); 5 Nov 2012 17:45:24 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55207] Automatic deallocation of variables declared in the main program Date: Mon, 05 Nov 2012 17:45: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-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-11/txt/msg00393.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55207 --- Comment #6 from janus at gcc dot gnu.org 2012-11-05 17:45:23 UTC --- Created attachment 28620 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28620 patch Here is an extended patch, based on comment 3, which fixes the storage_size_3 wrong-code problem (cf. gfc_trans_deferred_vars) and corrects the __builtin_free counts in the test cases. It still fails on the following: FAIL: gfortran.dg/c_ptr_tests_16.f90 -O scan-tree-dump-times optimized "i_do_not_exist" 0 FAIL: gfortran.dg/coarray_lib_alloc_2.f90 -O scan-tree-dump-times original "_gfortran_caf_deregister .&xx._data.token, 0B, 0B, 0.;" 1 FAIL: gfortran.dg/intent_optimize_1.f90 -O scan-tree-dump-times optimized "does_not_exist" 0 FAIL: gfortran.dg/volatile4.f90 -O scan-tree-dump-not optimized "NonVolatileNotOptimizedAway" FAIL: gfortran.dg/volatile6.f90 -O scan-tree-dump-not optimized "NonVolatileNotOptimizedAway1" Except for one coarray issue, those seem to be problems with optimizing away stuff in certain situations (I haven't checked any details yet).