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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166701
138bc75d-0d04-0410-961f-
82ee72b054a4
+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).
{
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;
}
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;
}
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);
+2010-11-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45742
+ * gfortran.dg/volatile12.f90: New.
+
2010-11-13 Paolo Bonzini <bonzini@gnu.org>
PR c/20385
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fdump-tree-optimized -O3" }
+!
+! PR fortran/45742
+!
+
+subroutine sub(arg)
+ integer, volatile :: arg
+ if (arg /= arg) call I_dont_exist()
+end
+
+! { dg-final { scan-tree-dump "integer.kind=.. . volatile arg" "optimized" } }
+! { dg-final { scan-tree-dump-times " =.v. arg;" 2 "optimized" } }
+! { dg-final { scan-tree-dump "i_dont_exist" "optimized" } }
+! { dg-final { cleanup-tree-dump "original" } }
+