public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/104845] New: Wrong array size for component of CLASS array element
@ 2022-03-08 19:50 burnus at gcc dot gnu.org
  2022-03-08 20:08 ` [Bug fortran/104845] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-03-08 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

            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=52585&action=edit
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 = 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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-21 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 19:50 [Bug fortran/104845] New: Wrong array size for component of CLASS array element burnus at gcc dot gnu.org
2022-03-08 20:08 ` [Bug fortran/104845] " burnus at gcc dot gnu.org
2022-03-09  9:40 ` burnus at gcc dot gnu.org
2022-04-21 17:26 ` mikael at gcc dot gnu.org

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).