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

            Bug ID: 102275
           Summary: Assumed rank, unlimited polymorphic pointer gives
                    incorrect behavious
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: paal at levold dot net
  Target Milestone: ---

Created attachment 51434
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51434&action=edit
Source code reproducing the issue

Possibly related to bug 100097.

Environment: GCC 11.2.0 Docker image from https://hub.docker.com/_/gcc.

The attached code uses a unlimited polymorphic pointer with assumed rank. When
running it produces the following output:

     This is correct:
     rank 0
     rank 1
     T T
     ptr0 =          123
     ptr1 =            1           2           3

     This is NOT correct:
     rank 0
     rank 0
     F T
     uptr1 =          123


The latter part is incorrect, it should be:

     rank 0
     rank 1
     T T
     uptr0 =          123
     uptr1 =            1           2           3

Reply via email to