diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-11-13 11:29:04 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-11-13 11:29:04 +0100 |
commit | c28d1d9b76e239a09711f983a39378ca521b498a (patch) | |
tree | 87faea60e6c62e4aef9c6bd2f88b0461dc3739bd /gcc/fortran | |
parent | 2f413185c295b3cf6baabb576bf05209572bf952 (diff) | |
download | gcc-c28d1d9b76e239a09711f983a39378ca521b498a.zip gcc-c28d1d9b76e239a09711f983a39378ca521b498a.tar.gz gcc-c28d1d9b76e239a09711f983a39378ca521b498a.tar.bz2 |
re PR fortran/45742 (VOLATILE has no effect)
2010-11-13 Tobias Burnus <burnus@net-b.de>
PR fortran/45742
* trans-common.c (build_field): Add TREE_SIDE_EFFECTS for
* volatile.
* trans-decl.c (gfc_finish_var_decl): Ditto.
(create_function_arglist): Handle volatile dummy arguments.
2010-11-13 Tobias Burnus <burnus@net-b.de>
PR fortran/45742
* gfortran.dg/volatile12.f90: New.
From-SVN: r166701
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 1 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 10 |
3 files changed, 18 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7d7a079..aa17885 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2010-11-13 Tobias Burnus <burnus@net-b.de> + + PR fortran/45742 + * trans-common.c (build_field): Add TREE_SIDE_EFFECTS for volatile. + * trans-decl.c (gfc_finish_var_decl): Ditto. + (create_function_arglist): Handle volatile dummy arguments. + 2010-11-12 Joseph Myers <joseph@codesourcery.com> * Make-lang.in (gfortranspec.o): Use $(OPTS_H). diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 486fbbb..1f59a69 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -322,6 +322,7 @@ build_field (segment_info *h, tree union_type, record_layout_info rli) { tree new_type; TREE_THIS_VOLATILE (field) = 1; + TREE_SIDE_EFFECTS (field) = 1; new_type = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE); TREE_TYPE (field) = new_type; } diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 3f068de..0441db7 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -555,6 +555,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym) if (sym->attr.volatile_) { TREE_THIS_VOLATILE (decl) = 1; + TREE_SIDE_EFFECTS (decl) = 1; new_type = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE); TREE_TYPE (decl) = new_type; } @@ -1944,10 +1945,19 @@ create_function_arglist (gfc_symbol * sym) if (f->sym->attr.proc_pointer) type = build_pointer_type (type); + if (f->sym->attr.volatile_) + type = build_qualified_type (type, TYPE_QUAL_VOLATILE); + /* Build the argument declaration. */ parm = build_decl (input_location, PARM_DECL, gfc_sym_identifier (f->sym), type); + if (f->sym->attr.volatile_) + { + TREE_THIS_VOLATILE (parm) = 1; + TREE_SIDE_EFFECTS (parm) = 1; + } + /* Fill in arg stuff. */ DECL_CONTEXT (parm) = fndecl; DECL_ARG_TYPE (parm) = TREE_VALUE (typelist); |