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/67740] Wrong association status of allocatable character pointer in derived types
Date: Wed, 27 Sep 2023 20:07:22 +0000	[thread overview]
Message-ID: <bug-67740-4-5LO6fjKXHG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67740-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67740

--- Comment #7 from anlauf at gcc dot gnu.org ---
The following snippet in gfc_trans_pointer_assignment looks suspicious:

      if (expr1->ts.type == BT_CHARACTER
          && expr1->symtree->n.sym->ts.deferred
          && expr1->symtree->n.sym->ts.u.cl->backend_decl
          && VAR_P (expr1->symtree->n.sym->ts.u.cl->backend_decl))
        {
          tmp = expr1->symtree->n.sym->ts.u.cl->backend_decl;
          if (expr2->expr_type != EXPR_NULL)
            gfc_add_modify (&block, tmp,
                            fold_convert (TREE_TYPE (tmp), strlen_rhs));
          else
            gfc_add_modify (&block, tmp, build_zero_cst (TREE_TYPE (tmp)));
        }

I wonder whether it should read:

      if (expr1->ts.type == BT_CHARACTER
          && expr1->ts.deferred
...

Furthermore, expr1->ts.u.cl->backend_decl appears not set properly,
and I fail to see why.

  parent reply	other threads:[~2023-09-27 20:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28  6:59 [Bug fortran/67740] New: " baradi09 at gmail dot com
2015-10-10 10:05 ` [Bug fortran/67740] " dominiq at lps dot ens.fr
2021-05-03 12:51 ` bardeau at iram dot fr
2023-09-26 19:57 ` anlauf at gcc dot gnu.org
2023-09-26 20:28 ` anlauf at gcc dot gnu.org
2023-09-27 20:07 ` anlauf at gcc dot gnu.org [this message]
2023-10-08  8:44 ` pault at gcc dot gnu.org
2023-10-08 20:43 ` anlauf at gcc dot gnu.org
2023-10-09 20:29 ` anlauf at gcc dot gnu.org
2023-10-12  6:27 ` cvs-commit at gcc dot gnu.org
2023-10-26  9:36 ` cvs-commit at gcc dot gnu.org
2023-10-26  9:39 ` pault at gcc dot gnu.org
2023-10-26 12:08 ` baradi09 at gmail dot com
2024-05-14 20:06 ` 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-67740-4-5LO6fjKXHG@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: link
Be 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).