This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran,patch] Fix matching of format labels (PR 34108)
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Nov 2007 15:45:04 -0800
- Subject: Re: [fortran,patch] Fix matching of format labels (PR 34108)
- References: <E1DB2866-251C-4F50-BA0F-7ABCDD5E2AC8@gmail.com>
FX Coudert wrote:
Attached patch fixes PR 34108, an ICE on invalid code such as "write
(*,0)". This is due to a checking the e->value.character.string of the
constant integer 0! This is fixed by the one line in
check_format_string, but I noted that the fact that we even came to that
point would be fixed is matching aborted earlier, with a more specific
error message (instead of "Missing left parenthesis"!). But we can do
better: if gfc_match_st_label() returns MATCH_ERROR, it means that it
found an integer, that is not a suitable label, and we should emit that
error message (either "label is zero" or "label has too many digits")
and bail out, because we can't recover from that anyway (there's no way
a litteral integer constant as format is valid if it's not a label).
Bootstrapped and regtested on x86_64-linux, comes with a testcase. OK
for mainline ?
FX
:ADDPATCH fortran:
OK,
Jerry