public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/53436] Volatile behaves strange with OpenMP
Date: Tue, 22 May 2012 09:55:00 -0000 [thread overview]
Message-ID: <bug-53436-4-PdXUW3mxkj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53436-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53436
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-22 07:59:01 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > The testcase is not valid OpenMP, there is no flush operation in between the
> > store and reads,
>
> Is that also needed with volatile variables? Would be quite counterintuitive.
I believe so. Volatile only makes sure the compiler emits a store of the
variable to memory, but the CPU can just store it into a cache. There is
nothing that orders that store compared to other stores/loads.
So, just use the appropriate OpenMP directives for synchronization, rather than
bad attempts at busy waiting using volatile.
next prev parent reply other threads:[~2012-05-22 7:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 12:44 [Bug tree-optimization/53436] New: " o.mangold at googlemail dot com
2012-05-21 21:07 ` [Bug tree-optimization/53436] " jakub at gcc dot gnu.org
2012-05-21 21:19 ` jakub at gcc dot gnu.org
2012-05-22 7:40 ` jakub at gcc dot gnu.org
2012-05-22 7:59 ` o.mangold at googlemail dot com
2012-05-22 9:55 ` jakub at gcc dot gnu.org [this message]
2012-05-22 9:59 ` o.mangold at googlemail dot com
2012-05-22 10:19 ` jakub at gcc dot gnu.org
2012-05-24 22:34 ` ebotcazou at gcc dot gnu.org
2012-05-24 22:37 ` pinskia at gcc dot gnu.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=bug-53436-4-PdXUW3mxkj@http.gcc.gnu.org/bugzilla/ \
--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).