public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/82314] internal compiler error: in gfc_conv_expr_descriptor, at fortran/trans-array.c:6972 Date: Tue, 07 Sep 2021 20:32:04 +0000 [thread overview] Message-ID: <bug-82314-4-hR1SxNqeQ0@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-82314-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82314 --- Comment #8 from anlauf at gcc dot gnu.org --- I am testing the following patch which fixes comment#0: diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 2e49a673e15..f2e8896b562 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -2169,6 +2169,24 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus) sym->as->type = AS_EXPLICIT; } + /* Ensure that explicit bounds are simplified. */ + if (sym->attr.flavor == FL_PARAMETER && sym->attr.dimension + && sym->as->type == AS_EXPLICIT) + { + for (int dim = 0; dim < sym->as->rank; ++dim) + { + gfc_expr *e; + + e = sym->as->lower[dim]; + if (e->expr_type != EXPR_CONSTANT) + gfc_reduce_init_expr (e); + + e = sym->as->upper[dim]; + if (e->expr_type != EXPR_CONSTANT) + gfc_reduce_init_expr (e); + } + } + /* Need to check if the expression we initialized this to was one of the iso_c_binding named constants. If so, and we're a parameter (constant), let it be iso_c.
next prev parent reply other threads:[~2021-09-07 20:32 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-82314-4@http.gcc.gnu.org/bugzilla/> 2020-06-03 15:41 ` gscfq@t-online.de 2020-06-30 20:26 ` anlauf at gcc dot gnu.org 2020-11-12 20:05 ` anlauf at gcc dot gnu.org 2021-09-07 20:32 ` anlauf at gcc dot gnu.org [this message] 2021-09-07 21:45 ` anlauf at gcc dot gnu.org 2021-09-13 17:28 ` cvs-commit at gcc dot gnu.org 2021-09-16 18:18 ` cvs-commit at gcc dot gnu.org 2021-09-30 19:04 ` cvs-commit at gcc dot gnu.org 2021-09-30 19:08 ` cvs-commit at gcc dot gnu.org 2021-09-30 19:09 ` anlauf 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-82314-4-hR1SxNqeQ0@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).