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

--- Comment #7 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Harald Anlauf from comment #6)
> Additional data points:
> 
> - The ICE in comment #4 can be reproduced with
> 
>   character(:), dimension(:), pointer :: p => NULL()
>   write(*,*) size(p)    ! ICE
>   write(*,*) len(p)     ! ICE
> end

The ICE is generated by the assert at trans-decl.c:1738

  /* Associate names can use the hidden string length variable
     of their associated target.  */
  if (sym->ts.type == BT_CHARACTER
      && TREE_CODE (length) != INTEGER_CST)
    {
      gfc_finish_var_decl (length, sym);
      gcc_assert (!sym->value);
    }

It does not show up when the initialization is removed,
or when the "pointer" is replaced by "allocatable".

Reply via email to