From: Richard Guenther <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Andrew MacLeod <amacleod@redhat.com>,
"Joseph S. Myers" <joseph@codesourcery.com>,
Aldy Hernandez <aldyh@redhat.com>,
Richard Henderson <rth@redhat.com>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [cxx-mem-model] disallow load data races (1 of some)
Date: Thu, 31 Mar 2011 13:32:00 -0000 [thread overview]
Message-ID: <AANLkTinOBUuGnCuOH8-ghwog4jSeBhqv8vxKceoeFWa1@mail.gmail.com> (raw)
In-Reply-To: <4D947CE0.2080909@redhat.com>
On Thu, Mar 31, 2011 at 3:08 PM, Jeff Law <law@redhat.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 03/24/11 17:57, Andrew MacLeod wrote:
>> My fault for not being specific about it... I tend to just use data race
>> as a catch all for all these types of things when talking about them
>> with Aldy.
>>
>> the testcase should have for (x=0; x< limit; x++) sum[x] = global;
>> rather than x<5, so that its not a known loop count.
>>
>> The hoisted load is then not allowed as it become a speculative load of
>> 'global' on the main path which would not otherwise have been there.
>> When the value of limit < 0, this can cause a load race detection on
>> systems with either a software or hardware data race detector.
> We generally don't allow this kind of code motion anyway -- though it's
> more because we haven't built any kind of analysis to determine that
> this kind of speculative load is often profitable and can't result in a
> fault.
>
> However, having a switch we can throw to avoid this behaviour (assuming
> we add this kind of speculative code motion one day) is, IMHO, a good thing.
If we know the access to global cannot trap I see no reason to disallow
speculative reading of it.
Richard.
> Jeff
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNlHzgAAoJEBRtltQi2kC7h24H/1TJ9gdSKfPwjtiKQL7BLraO
> yAwvJJJihacO3xM2pkVZIXRVlHwFyqzU03x0ygExMOex3QMuLMByBbpxsk3uQV7t
> 30xF5MDEdXEmQ7L1jWI7gYXbKZk5lnJhDQKewPePdUbcVzJj3H71SQGP2uWCLMUE
> 7ToPioN2w3DazoWdnYC/Jqi5JwBLnKpcxkGXQPYbCvqII8W5Xkmlh743Zq5RF7ax
> q1nAkRmKdsgIq0SJJNF0GVxdzfOQkt1q7yzR7W74PCG1h6Yam6DNsePSbswDSu46
> 0gxkqnlGb6dkgx1iCHAS0PtNDAurGVCAOd5rijH1yib7C+P48XLmoF10Y13v82I=
> =D+1J
> -----END PGP SIGNATURE-----
>
next prev parent reply other threads:[~2011-03-31 13:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 17:33 Aldy Hernandez
2011-03-24 19:58 ` Richard Henderson
2011-03-24 21:31 ` Aldy Hernandez
2011-03-24 21:51 ` Joseph S. Myers
2011-03-24 23:57 ` Andrew MacLeod
2011-03-25 10:03 ` Richard Guenther
2011-03-25 12:58 ` Aldy Hernandez
2011-03-25 15:27 ` Michael Matz
2011-03-25 15:33 ` Jeff Law
2011-03-25 15:35 ` Jakub Jelinek
2011-03-25 15:46 ` Richard Guenther
2011-03-29 16:52 ` Aldy Hernandez
2011-03-31 13:12 ` Jeff Law
2011-03-31 13:32 ` Richard Guenther [this message]
2011-03-31 13:32 ` Jeff Law
2011-03-31 21:07 ` Michael Matz
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=AANLkTinOBUuGnCuOH8-ghwog4jSeBhqv8vxKceoeFWa1@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=joseph@codesourcery.com \
--cc=law@redhat.com \
--cc=rth@redhat.com \
/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).