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

Steve Kargl <kargl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-01-23

--- Comment #2 from Steve Kargl <kargl at gcc dot gnu.org> ---
The problem appears to lie in expr.cc(gfc_is_not_contiguous).
We have this loop:

  for (ref = array->ref; ref; ref = ref->next)
    {
      /* Array-ref shall be last ref.  */

      if (ar && ar->type != AR_ELEMENT)
        return true;

      if (ref->type == REF_ARRAY)
        ar = &ref->u.ar;
    }

The first step into the loop gives

(gdb) p ref->type
$14 = REF_ARRAY

This is the array 'a', and 'ar' is set to

(gdb) p *ar
$16 = {type = AR_FULL, dimen = 1, codimen = 0, in_allocate = false, 
  team_type = TEAM_UNKNOWN, team = 0x0, stat = 0x0, where = {nextc =
0x804298ea4, 
    u = {lb = 0x804298e60, location = 34429570656}}, as = 0x80421aa00, c_where
= {{
      nextc = 0x0, u = {lb = 0x0, location = 0}} <repeats 15 times>}, start = {
    0x0 <repeats 15 times>}, end = {0x0 <repeats 15 times>}, stride = {
    0x0 <repeats 15 times>}, dimen_type = {DIMEN_RANGE, 0 <repeats 14 times>}}

This next trip through the loop advances to 

(gdb) p ref->next->type
$15 = REF_COMPONENT

and gfortran returns 'true' from the first if statement in loop.

Reply via email to