public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/60522] [4.7/4.8/4.9 Regression] WHERE construct causes an ICE in gfc_trans_where_2 Date: Fri, 14 Mar 2014 20:20:00 -0000 [thread overview] Message-ID: <bug-60522-4-hXMpnn2C11@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-60522-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60522 Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> --- BLOCK constructs are not allowed inside WHERE constructs. Thus, the "common function optimization" should not create a BLOCK to hold the temporary variables, at least not inside WHERE. Another possible fix, the following patch disables the optimization inside WHERE. diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 52bd700..dc641de 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -630,9 +630,16 @@ static int cfe_code (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED) { - current_code = c; - inserted_block = NULL; - changed_statement = NULL; + /* BLOCK constructs cannot appear inside WHERE blocks; as the optimization + may introduce the former we disable it inside the latter. */ + if ((*c)->op == EXEC_WHERE) + *walk_subtrees = 0; + else + { + current_code = c; + inserted_block = NULL; + changed_statement = NULL; + } return 0; }
next prev parent reply other threads:[~2014-03-14 20:20 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-03-14 8:15 [Bug fortran/60522] New: " roger.ferrer at bsc dot es 2014-03-14 19:14 ` [Bug fortran/60522] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr 2014-03-14 20:20 ` mikael at gcc dot gnu.org [this message] 2014-03-14 23:24 ` tkoenig at gcc dot gnu.org 2014-03-27 22:22 ` tkoenig at gcc dot gnu.org 2014-03-28 7:17 ` tkoenig at gcc dot gnu.org 2014-03-29 11:51 ` tkoenig at gcc dot gnu.org 2014-03-29 11:53 ` tkoenig 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-60522-4-hXMpnn2C11@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).