public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55207] Automatic deallocation of variables declared in the main program Date: Sun, 04 Nov 2012 22:48:00 -0000 [thread overview] Message-ID: <bug-55207-4-l6ulgDHwOS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55207-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55207 --- Comment #3 from janus at gcc dot gnu.org 2012-11-04 22:48:37 UTC --- The following patch applies the implicit SAVE attribute to variables declared in the main program: Index: gcc/fortran/decl.c =================================================================== --- gcc/fortran/decl.c (revision 193137) +++ gcc/fortran/decl.c (working copy) @@ -3812,9 +3812,11 @@ match_attr_spec (void) } } - /* Since Fortran 2008 module variables implicitly have the SAVE attribute. */ - if (gfc_current_state () == COMP_MODULE && !current_attr.save - && (gfc_option.allow_std & GFC_STD_F2008) != 0) + /* Since Fortran 2008, variables declared in a MODULE or PROGRAM + implicitly have the SAVE attribute. */ + if ((gfc_current_state () == COMP_MODULE + || gfc_current_state () == COMP_PROGRAM) + && !current_attr.save && (gfc_option.allow_std & GFC_STD_F2008) != 0) current_attr.save = SAVE_IMPLICIT; colon_seen = 1; This also removes the automatic allocation of both variables in the test case in comment 0. Therefore it has the same testsuite failures as the patch in comment 1 (possibly more?).
next prev parent reply other threads:[~2012-11-04 22:48 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-11-04 18:27 [Bug fortran/55207] New: " janus at gcc dot gnu.org 2012-11-04 18:32 ` [Bug fortran/55207] " janus at gcc dot gnu.org 2012-11-04 22:27 ` janus at gcc dot gnu.org 2012-11-04 22:48 ` janus at gcc dot gnu.org [this message] 2012-11-05 9:07 ` janus at gcc dot gnu.org 2012-11-05 9:37 ` janus at gcc dot gnu.org 2012-11-05 17:45 ` janus at gcc dot gnu.org 2013-07-22 11:01 ` janus at gcc dot gnu.org 2013-07-31 20:43 ` janus at gcc dot gnu.org 2013-08-01 14:58 ` janus at gcc dot gnu.org 2013-08-01 15:02 ` janus at gcc dot gnu.org 2013-08-06 8:29 ` janus at gcc dot gnu.org 2013-12-18 11:46 ` [Bug fortran/55207] [F08] Variables declared in the main program should implicitly get the SAVE attribute janus at gcc dot gnu.org 2014-03-15 10:53 ` janus at gcc dot gnu.org 2014-03-15 11:12 ` dominiq at lps dot ens.fr 2014-03-15 12:14 ` janus at gcc dot gnu.org 2014-03-18 22:15 ` janus at gcc dot gnu.org 2014-03-18 22:23 ` janus at gcc dot gnu.org 2015-10-21 10:32 ` jb at gcc dot gnu.org 2023-03-18 17:40 ` pault at gcc dot gnu.org 2023-03-18 17:40 ` pault at gcc dot gnu.org 2023-05-02 13:23 ` burnus at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-55207-4-l6ulgDHwOS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).