From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E47D3858C83; Tue, 8 Mar 2022 19:50:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E47D3858C83 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/104845] New: Wrong array size for component of CLASS array element Date: Tue, 08 Mar 2022 19:50:33 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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 keywords bug_severity priority component assigned_to reporter target_milestone attachments.created 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: Tue, 08 Mar 2022 19:50:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104845 Bug ID: 104845 Summary: Wrong array size for component of CLASS array element Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- Created attachment 52585 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D52585&action=3Dedit Testcase (test.f90) The attached testcase has: type t2 class(t), allocatable :: d(:,:) end type t2 which is allocated as: allocate (t :: var%ct2%d(3,2), var%ct2a(5,4,2)%d(3,2)) allocate (t :: cvar%ct2%d(3,2), cvar%ct2a(5,4,2)%d(3,2)) Thus, the expected array size is 3*2 =3D 6. However, the result is 6 0 6 0 for print *, size(var%ct2%d), size(var%ct2a(5,3,2)%d), & size(cvar%ct2%d), size(cvar%ct2a(5,3,2)%d) where 'ct2' is scalar and 'ct2a(5,3,2)' is an array element (also scalar)=