[patch, fortran] Fix PR 69544
Dominique d'Humières
dominiq@lps.ens.fr
Tue Nov 1 14:22:00 GMT 2016
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
More information about the Fortran
mailing list