From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37B1F385782C; Mon, 21 Dec 2020 08:35:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37B1F385782C From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/98408] New: Character lengths for allocatable character arrays Date: Mon, 21 Dec 2020 08:35:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 21 Dec 2020 08:35:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98408 Bug ID: 98408 Summary: Character lengths for allocatable character arrays Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: tkoenig at gcc dot gnu.org Target Milestone: --- Consider program main character (len=3D:), allocatable :: a(:) allocate (character(len=3D10) :: a(5)) end program main This yields (in the tree dump) D.3941 =3D (bitsizetype) (sizetype) NON_LVALUE_EXPR <.a> * 8; D.3942 =3D (sizetype) NON_LVALUE_EXPR <.a>; a.data =3D 0B; { integer(kind=3D4) overflow.0; logical(kind=3D4) not_prev_allocated.1; .a =3D 10; And later, if you use size_in_bytes (gfc_get_element_type (TREE_TYPE(se->expr))) you get an undefined variable. Strange...=