This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Fix PR 69544
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 1 Nov 2016 15:22:32 +0100
- Subject: Re: [patch, fortran] Fix PR 69544
- Authentication-results: sourceware.org; auth=none
Hi Thomas,
> the attached, rather simple, patch, fixes a regression where
> the locus was not set, leading to an ICE on a warning.
Looking for the occurrences of gfc_clear_new_st in fortran/match.c, I have found it in the following procs:
gfc_match_if
match_simple_forall
gfc_match_forall
match_simple_where
gfc_match_where
In the first three, gfc_current_locus is provided, but not in the last two. The patch fixes the ICE due to the missing gfc_current_locus in the last one, but the same should be applied to match_simple_where, otherwise one gets an ICE for statements such as
if (n==10) where (txt(1:3) /= '' ) y(1:3,i,j) = txt(1:3)
Note that there is no comment explaining the need of gfc_current_locus where it is presently implemented. Is the new comment really needed?
IMO a similar audit should be performed for fortran/parse.c (11 occurrences of gfc_clear_new_st).
Thanks for taking care of this issue,
Dominique