public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35037] VOLATILE attribute not being honored with common block variable
Date: Fri, 01 Feb 2008 22:55:00 -0000	[thread overview]
Message-ID: <20080201225456.24371.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35037-15045@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2008-02-01 22:54 -------
I've tried the following "trivial" patch (which should handle both common
blocks and equivalences):

Index: trans-common.c
===================================================================
--- trans-common.c      (revision 131944)
+++ trans-common.c      (working copy)
@@ -678,6 +678,14 @@ create_common (gfc_common_head *com, seg
       /* This is a fake variable just for debugging purposes.  */
       TREE_ASM_WRITTEN (var_decl) = 1;

+      if (s->sym->attr.volatile_)
+       {
+         tree new;
+         TREE_THIS_VOLATILE (var_decl) = 1;
+         new = build_qualified_type (TREE_TYPE (var_decl),
TYPE_QUAL_VOLATILE);
+         TREE_TYPE (var_decl) = new;
+       }
+
       if (com)
        var_decl = pushdecl_top_level (var_decl);
       else


But it looks like it doesn't work. Actually, even without the common block, it
doesn't seem to work:

      subroutine wait4it ()
        logical event
        volatile event
        do
          if (event) exit
        end do
      end subroutine

But I'm useless at reading assembly (the tree dump doesn't have these
attributes written out) and I'm not too sure if the code above is legal, so I'd
be glad for someone to help.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35037


  parent reply	other threads:[~2008-02-01 22:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31  4:47 [Bug fortran/35037] New: " w6ws at earthlink dot net
2008-01-31  5:08 ` [Bug fortran/35037] " w6ws at earthlink dot net
2008-01-31 14:35 ` burnus at gcc dot gnu dot org
2008-02-01 22:55 ` fxcoudert at gcc dot gnu dot org [this message]
2008-02-04 20:59 ` burnus at gcc dot gnu dot org
2008-02-04 22:52 ` fxcoudert at gcc dot gnu dot org
2008-02-05  0:42 ` fxcoudert at gcc dot gnu dot org
2008-02-05  1:25 ` w6ws at earthlink dot net
2008-02-05 21:08 ` fxcoudert at gcc dot gnu dot org
2008-02-05 21:08 ` fxcoudert at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080201225456.24371.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).