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

            Bug ID: 127611
           Summary: Polymorphic array pointer access use the size from the
                    vptr as span
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikael at gcc dot gnu.org
  Target Milestone: ---

This is a followup to PR127448, with the same testcase.
The fix pushed as r17-4529 only fixes the pointer assignment problem.
Some fails remain in the testcase despite that fix.

Quoting the analysis from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127448#c1 :
> The copy to a temporary:
>     (*(struct t1[0:] * restrict) atmp.54.data)[S.55] = *(struct t1 *)
> (z1._data.data + (sizetype) (((S.55 + D.5217) * D.5219 + D.5202) *
> z1._vptr->_size));
> 
> is using the size from the vptr as span, which is assuming z1 to be
> contiguous.

This PR is about this array access problem of usage _vptr._size instead of
_data.span.

Reply via email to