[patch, fortran] Implement VOLATILE statement/attribute (PR 29601)

Tobias Burnus burnus@net-b.de
Tue Nov 7 10:10:00 GMT 2006


Hi FX,

FX Coudert wrote:
> I'm afraid these comments are coming one after another, but I just
> thought of another place you need to add VOLATILE support:
> gfc_show_attr in dump-parse-tree.c. The good news is that it's trivial
> to add :)
(I found the rest also not so difficult to add, except for finding
TYPE_QUAL_VOLATILE; the most difficult part is to find all places where
one needs to change things [QED]. But it gave indeed a nice tour through
gfortran's parser.)

I added the two lines but no test case.
+  if (attr->volatile_)
+    gfc_status (" VOLATILE");

Besides I'm angry with me that I didn't realized it myself. (I did look
at -dump-parse-tree recently, didn't saw VOLATILE but didn't realize
that is was my task.)

Bootstrapped without that two lines, build (make, make install) with
that patch and
run "make check-gfortran" on x86_64-unknown-linux-gnu. (I also checked
manually gfortran -fdump-parse-tree.)

Tobias

fortran/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

    fortran/29601
    * symbol.c (check_conflict, gfc_add_volatile): Add volatile support.
    * decl.c (match_attr_spec, gfc_match_volatile): Add volatile support.
    * 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.
    * modules.c (ab_attribute, attr_bits, mio_symbol_attribute):
      Add volatile support.
    * dump-parse-tree.c (gfc_show_attr): Add volatile support.


testsuite/
2006-11-06  Tobias Burnus  <burnus@net-b.de>

    fortran/29601
    * volatile.f90: Add.
    * volatile2.f90: Add.
    * volatile3.f90: Add.
    * volatile4.f90: Add.
    * volatile5.f90: Add.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: volatile5.diff
Type: text/x-patch
Size: 14292 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061107/87d6a4b5/attachment.bin>


More information about the Gcc-patches mailing list