From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 09D01393A40D; Mon, 3 May 2021 12:51:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09D01393A40D From: "bardeau at iram dot fr" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bardeau at iram dot fr X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2021 12:51:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D67740 Sebastien Bardeau changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bardeau at iram dot fr --- Comment #4 from Sebastien Bardeau --- 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 standal= one pointer (i.e. out of the derived type), I have no issue then. program test2 character(len=3D10), target, allocatable :: s(:) type :: pointer_typec0_t character(len=3D:), pointer :: data1(:) end type pointer_typec0_t type(pointer_typec0_t) :: co ! allocate(s(3)) s(1) =3D '1234567890' s(2) =3D 'qwertyuio ' s(3) =3D 'asdfghjk ' ! co%data1 =3D> 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=