This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35037] VOLATILE attribute not being honored with common block variable
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Feb 2008 20:58:27 -0000
- Subject: [Bug fortran/35037] VOLATILE attribute not being honored with common block variable
- References: <bug-35037-15045@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2008-02-04 20:58 -------
> But I'm useless at reading assembly (the tree dump doesn't have these
> attributes written out)
Try something like the following with -O3 -fdump-tree-optimized:
subroutine wait4it ()
logical event
volatile event
! common /dd/ event
event = .false.
do
if (event) print *, 'gfhzjf'
end do
end subroutine
I did not test your patch, but without the common line, the dump contains
"gfhzjf" until you remove the volatile. This saves you from reading assembler.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35037