This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] Implement VOLATILE statement/attribute (PR 29601)
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Mon, 6 Nov 2006 10:21:32 +0100
- Subject: Re: [patch, fortran] Implement VOLATILE statement/attribute (PR 29601)
- References: <4546974A.email@example.com> <454CDA91.firstname.lastname@example.org> <454CED75.email@example.com>
First, thanks for taking care of this. I think you're getting a nice
tour of the Fortran front-end :)
As suggested by FX via IRC:
1. Changed error message to the standard(?) wording:
- "In the selected standard, the
+ "New in Fortran 2003: the VOLATILE "
"attribute is not allowed at %C")
For the error message, I'd be OK with Steve changing all "New in
Fortran 2003" into "Fortran 2003". Also, I think it will have to be
the subject of another follow-up patch, because we don't want to make
it too hard to get this VOLATILE patch in. So, use either "New in
Fortran 2003" or "Fortran 2003", and we'll do the overall change later.
2. Added volatile4.f90 which shows that a volatile variable is not
2006-11-04 Tobias Burnus <firstname.lastname@example.org>
* symbol.c (check_conflict, gfc_add_volatile): Add volatile
* decl.c (match_attr_spec, gfc_match_volatile): Add volatile
* gfortran.h (symbol_attribute): Add volatile_ to struct.
* resolve.c (was_declared): Add volatile support.
* trans-decl.c (gfc_finish_var_decl): Add volatile support.
* match.h: Declare gfc_match_volatile.
* parse.c (decode_statement): Recognize volatile.
I can think of at least one thing you've missed: modules. This is all
in module.c, grep for AB_TARGET to see how attributes are handled,
and you can most probably handle it the same way (it should only be a
few more lines to change). If you could also add another optimized-
out variable, coming from a module where it is specified VOLATILE, in
your testcase, that would be nice.
Also, making grep-ing TARGET in gcc/fortran/ to make sure there's
nothing else you and I are forgetting would be nice.