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

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Harald Anlauf from comment #2)
> Actually, the problem is not related to zero length arrays, but to the
> constructor [integer::].  I think this is related to several other PRs.

Looking at the dump-tree parts related to the lines

>   integer, parameter :: m(0) = 42
>   call i(m)
>   call i([integer::])
>   call i([integer::m])

shows that only the first call variant has a sane version of the
actual argument, while the other two have two(!) strange array
descriptors with a NULL data pointer, e.g.:

      struct array01_integer(kind=4) atmp.8;
      struct array01_integer(kind=4) atmp.10;

            typedef integer(kind=4) [0];
      atmp.8.dtype = {.elem_len=4, .rank=1, .type=1};
      atmp.8.dim[0].stride = 1;
      atmp.8.dim[0].lbound = 0;
      atmp.8.dim[0].ubound = -1;
      atmp.8.data = 0B;
      atmp.8.offset = 0;
            typedef integer(kind=4) [0];
      atmp.10.dtype = {.elem_len=4, .rank=1, .type=1};
      atmp.10.dim[0].stride = 1;
      atmp.10.dim[0].lbound = 0;
      atmp.10.dim[0].ubound = -1;
      atmp.10.data = 0B;
      atmp.10.offset = 0;

A bookkeeping issue?

Reply via email to