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/110288] [11/12/13/14] Regression: segfault in findloc with allocatable array of allocatable characters Date: Mon, 10 Jul 2023 20:50:10 +0000 [thread overview] Message-ID: <bug-110288-4-EXUFcoytfI@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-110288-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110288 --- Comment #3 from anlauf at gcc dot gnu.org --- The apparent discrepancy between fndecl and the actual arguments in the call may be a result from the following block in gfc_conv_procedure_call after: 7390 /* Deferred length dummies pass the character length by reference 7391 so that the value can be returned. */ 7392 if (parmse.string_length && fsym && fsym->ts.deferred) ... The following patch fixes the testcase and regtests ok so far: diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index 7017b652d6e..8ed812bff0d 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -7404,7 +7404,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, tmp = parmse.string_length; if (!VAR_P (tmp) && TREE_CODE (tmp) != COMPONENT_REF) tmp = gfc_evaluate_now (parmse.string_length, &se->pre); - parmse.string_length = gfc_build_addr_expr (NULL_TREE, tmp); + if (fsym->attr.allocatable || fsym->attr.pointer) + parmse.string_length = gfc_build_addr_expr (NULL_TREE, tmp); + else + parmse.string_length = tmp; } if (e && e->expr_type == EXPR_VARIABLE Needs more checking.
next prev parent reply other threads:[~2023-07-10 20:50 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-16 14:46 [Bug fortran/110288] New: [11/12/13] " zed.three at gmail dot com 2023-06-16 16:38 ` [Bug fortran/110288] [11/12/13/14] " anlauf at gcc dot gnu.org 2023-07-09 20:38 ` anlauf at gcc dot gnu.org 2023-07-10 20:50 ` anlauf at gcc dot gnu.org [this message] 2023-07-11 18:21 ` anlauf at gcc dot gnu.org 2023-07-11 19:40 ` anlauf at gcc dot gnu.org 2023-07-11 20:26 ` cvs-commit at gcc dot gnu.org 2023-07-13 17:38 ` anlauf at gcc dot gnu.org 2023-07-14 18:27 ` cvs-commit at gcc dot gnu.org 2023-07-14 18:32 ` cvs-commit at gcc dot gnu.org 2023-07-14 18:35 ` cvs-commit at gcc dot gnu.org 2023-07-14 18:39 ` 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-110288-4-EXUFcoytfI@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).