public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bardeau at iram dot fr" <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: Mon, 03 May 2021 12:51:45 +0000 [thread overview] Message-ID: <bug-67740-4-JQaUdOpxxP@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 Sebastien Bardeau <bardeau at iram dot fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bardeau at iram dot fr --- Comment #4 from Sebastien Bardeau <bardeau at iram dot fr> --- I have pretty much the same kind of issue with gfortran 10.2.0 and 11.0.1 (20210426). The following code shows invalid results (printed lengths are 0). Sometimes I even get a program crash. If the 'data1' component is a standalone pointer (i.e. out of the derived type), I have no issue then. program test2 character(len=10), target, allocatable :: s(:) type :: pointer_typec0_t character(len=:), pointer :: data1(:) end type pointer_typec0_t type(pointer_typec0_t) :: co ! allocate(s(3)) s(1) = '1234567890' s(2) = 'qwertyuio ' s(3) = 'asdfghjk ' ! co%data1 => s ! print *,len(co%data1(1)),len_trim(co%data1(1)),co%data1(1) print *,len(co%data1(2)),len_trim(co%data1(2)),co%data1(2) print *,len(co%data1(3)),len_trim(co%data1(3)),co%data1(3) end program test2
next prev parent reply other threads:[~2021-05-03 12:51 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 [this message] 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 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-JQaUdOpxxP@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).