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

--- Comment #5 from kargls at comcast dot net ---
(In reply to anlauf from comment #4)
> (In reply to kargls from comment #1)
> > (In reply to philippe.wautelet from comment #0)
> > 
> > > 
> > > I'm not sure it is conforming to the Fortran standard but it shouldn't
> > > trigger an ICE.
> > > 
> > 
> > I agree with you about the ICE should not happen.  Staring at F2023,
> > I find the following constraint.
> > 
> > C8107 (R871) The namelist-group-name shall not be a name accessed by use
> > association.
> > 
> > If I understand it, your code is nonstandard.  But, I don't use namelist, so
> > will need to read through the Fortran standard a bit more.
> 
> This constraint applies to the namelist statement and does not apply to the
> issue here.

Yeah, I needed to review more the Fortran, and you beat me
to working out a patch.  The '(R871)' above restricts the
constraint to namelist statement.  However, this did lead to

module mod_nml1
   implicit none
   logical :: ldiag
   namelist /nam_nml1/ldiag
end module mod_nml1

program ice_nml
   use mod_nml1
   implicit none
   integer :: ilu, j
   namelist /nam_nml1/j  !<-- Does this violates C8107?
   ldiag = .false.
   j = 42
   write(*,nml=nam_nml1)
end program ice_nml

% gfcx -o z a.f90 && ./z
&NAM_NML1
 LDIAG=F,
 J=42         ,
 /

Reply via email to