Re: [patch, fortran] Fix two issues with unused/unset variable warnings.
Jerry D <[email protected]> Sat, 4 Jul 2026 09:57:22 -0700
| Newsgroups | gmane.comp.gcc.patches,gmane.comp.gcc.fortran |
|---|---|
| Message-ID | <[email protected]> |
On 7/4/26 4:33 AM, Thomas Koenig wrote: > Hello world, > > what it says in the ChangeLog. > > OK for trunk? Yes, OK and thanks Thomas. Cheers, Jerry> > Best regards > > Thomas > > Fix two issues with unused/unset variable warnings. > > This patch fixes an ICE and adds correct diagnostics for reading/writing > variables via namelist, plus sets error variables for STOP as used > so incorrect warnings are avoided. > > gcc/fortran/ChangeLog: > > PR fortran/126058 > PR fortran/126090 > * gfortran.h (gfc_dt): Add member nml_where. > * io.cc (match_dt_element): Set nml_where. > (gfc_resolve_dt): Mark variable in namelist to be read with > correct locus and VALUE_READ. Mark expression in write namelist as > used. > (match_io): Set nml_where for data transfer. > * resolve.cc: Mark code->expr1 as used for PAUSE, STOP and ERROR > STOP. > > gcc/testsuite/ChangeLog: > > PR fortran/126058 > PR fortran/126090 > * gfortran.dg/warn_undefined_vars_5.f90: New test. > * gfortran.dg/warn_undefined_vars_6.f90: New test.