------- Comment #2 from burnus at gcc dot gnu dot org 2008-01-31 13:59 -------
trans-decl has:
if (sym->attr.volatile_)
{
TREE_THIS_VOLATILE (decl) = 1;
new = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE);
TREE_TYPE (decl) = new;
}
However, variables which are in COMMON blocks have their symbols generated in
trans-common.c.
One should try to mark as little as possible as VOLATILE to allow more
optimization. (Fortran 2003 allows a use/host-associated variable to be marked
as volatile, i.e. if it is used elsewhere it is not volatile.)
As vendor extension (incl. g77) one can mark also a complete common block as
volatile: PR 34928.
EQUIVALENT should be checked as well.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC host triplet|i686-pc-cygwin |
GCC target triplet|i686-pc-cygwin |
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2008-01-31 13:59:37
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35037